Home » Modeling » Papyrus » Display of an association defined in a profile by an association between two stereotypes(Is it possible in the model to display the line between the two stereotyped objects ?)
|
Re: Display of an association defined in a profile by an association between two stereotypes [message #1496286 is a reply to message #1496183] |
Tue, 02 December 2014 23:18 |
|
Hi, Philippe,
The red lines that you're looking for in the diagram on the last page
of the PDF would represent the associations between stereotypes, right?
The problem is that stereotypes are at a higher "meta-level" than what
is shown in the diagram. Association lines in the diagram would
represent assocations between the classes that are shown in the
diagram, but the associations in this example are between stereotypes,
not the classes.
It would be akin to showing the associations between metaclasses such
as Class, Operation, and Property from the UML metamodel on the
diagram. It's the wrong meta-level. I don't think the UML spec
prescribes any visualization of stereotype associations in diagrams (I
could be mistaken).
HTH,
Christian
On 2014-12-02 21:22:20 +0000, Philippe Revellat said:
> I create a profile at the root of the profile :
> - three stereotypes A, B C extending the metaclass « Class »
> - each stereotype has a property
> - one association between A and B ;
> - one association between B and C
> - one stereotype D specialization of C
>
> All the object are in a unique diagram
> I can use this profile for a SysML model :
> - add stereotype to Class,
> - update the property in the tab profile of the tab property
> - display the property in a a compartment
> - display the association in one of the two Class of the association.
>
> But it is not possible to display the line corresponding to
> association, between the two classes.
>
> Is there a solution ?
>
> I add a pdf file to explain the problem
> <image>
|
|
|
Re: Display of an association defined in a profile by an association between two stereotypes [message #1496939 is a reply to message #1496183] |
Wed, 03 December 2014 12:01 |
Camille Letavernier Messages: 952 Registered: February 2011 |
Senior Member |
|
|
Hi,
If it semantically makes sense (That's hard to say in this case ), you can specify that "D" is an extension of "Association", "Dependency", or even "Property". These concepts can be represented as graphical links in a Class Diagram (For Property; not yet in Papyrus, but it should be possible according to UML).
So, the relationship between A and B could be a dependency between their base UML elements, or a Property A typed with Classifier B.
However, profiles shouldn't be notation-driven, so this can only make sense in some specific cases (When you can reuse UML Meta-Associations)
Regards,
Camille
Camille Letavernier
|
|
| |
Re: Display of an association defined in a profile by an association between two stereotypes [message #1498768 is a reply to message #1497521] |
Thu, 04 December 2014 17:03 |
|
Hi, Philippe,
Perhaps I'm not understanding what you're trying to do.
If you want the class diagram to have an association between, for
example, Class2 and Class3, then you must draw an association between
them. Associations that may exist between stereotypes applied to those
classes have nothing whatever to do with associations between the
classes that have the stereotypes applied.
Structure at the stereotype ("meta") level is independent of structure
in the model.
HTH,
Christian
On 2014-12-03 21:55:14 +0000, Philippe Revellat said:
> Hi Christian,
>
> Thank you for your answer.
>
> The first page of the document is the profile. All the other page
> belongs to a model containing only classes stereotyped by the
> stereotypes of the profile.
> The red lines in the diagram on the last page of the PDF would
> represent the associations between the classes and not between the
> stereotypes. The links between the stereotypes appears in the profile
> (first page of the document)
> By example - the Class3 is stereotyped with the stereotype C;
> - the Class2 is stereotyped with the stereotype B
> In the profile, there is an association between The stereotype C and
> the stereotype B with a cardinality 1 .. 1.
>
> After applying the stereotypes to Class2 and Class3 I can enter and
> display in a compartment of the class the value of the property "name"
> as defined in the stereotype and the reference of the class associated
> to Class3 (e.g. Class 2) as defined in the stereotype. All that is
> perfect. The only thing missing is the line between the two classes.
> Ph Revellat
>
> .
|
|
|
Re: Display of an association defined in a profile by an association between two stereotypes [message #1501051 is a reply to message #1498768] |
Sat, 06 December 2014 12:50 |
Philippe Revellat Messages: 12 Registered: July 2009 |
Junior Member |
|
|
Hi Christian,
Thank you for your answer.
To explain better what I am trying to do, I have create a small example concerning productline :
- A profile with only three stereotypes extending Class : "Variant", "VariationPoint" and "Constraint" an no Association.
- Using this profile, I have created a model with two "VariationPoint", each owing two "Variant" and a "Constraint" between two "Variant".
What am I trying to do :
I Which to be able to represent in the diagram of the model :
- The association between the "VariationPoint" and the "Variant"with this requirement :
A "Variant" shall own an association with a "VariationPoint" and only one.
- A "Constraint" shall own exactly two associations with two "Variant", or two "VariationPoint" or one "Variant" ans one "VariationPoint"
I want constrain the model with this kind of requirements on the associations by the mean of the profile. It is evident that to obtain this result I must also use OCL constraint.
Philippe,
PS I try an other thing :
In the package "block" of the SysML profile, there are three associations concerning "ValueType", "Dimension" and "Unit".
In a very small model I try to use these objects : the result is exactly the result I obtain with my profile and SysML is OK. It seems evident that I am not using the correct method.
-
Attachment: plm-001.pdf
(Size: 50.35KB, Downloaded 198 times)
|
|
|
Re: Display of an association defined in a profile by an association between two stereotypes [message #1503475 is a reply to message #1501051] |
Mon, 08 December 2014 13:59 |
|
Hi, Philippe,
OK, now the example has associations between the stereotyped classes,
not between the stereotypes, which is good.
The support for definition of OCL constraints on stereotypes in Papyrus
will let you do what you need. You can add a constraint to the Variant
stereotype that is something like this (untried and untested, but some
experimentation will find the correct formulation):
self.base_Class.association->one(
endType->excluding(self.base_Class)->exists(e |
e.oclIsKindOf(uml::Class) and
e.oclAsType(uml::Class).extension_VariationPoint->notEmpty()))
and to the Constraint stereotype:
self.base_Class.association->size() = 2 and
self.base_Class.association->forAll(
endType->forAll(e | e.oclIsKindOf(uml::Class) and
(e.oclAsType(uml::Class).extension_Variant->notEmpty() or
e.oclAsType(uml::Class).extension_VariationPoint->notEmpty())))
So, even as you described them yourself, the constraints are not so
much on the associations as on the types that are associated. :-)
HTH,
Christian
On 2014-12-06 12:50:54 +0000, Philippe Revellat said:
> Hi Christian,
>
> Thank you for your answer.
>
> To explain better what I am trying to do, I have create a small example
> concerning productline :
> - A profile with only three stereotypes extending Class : "Variant",
> "VariationPoint" and "Constraint" an no Association.
> - Using this profile, I have created a model with two "VariationPoint",
> each owing two "Variant" and a "Constraint" between two "Variant".
>
> What am I trying to do :
>
> I Which to be able to represent in the diagram of the model :
>
> - The association between the "VariationPoint" and the "Variant"with
> this requirement :
> A "Variant" shall own an association with a "VariationPoint" and only one.
>
> - A "Constraint" shall own exactly two associations with two "Variant",
> or two "VariationPoint" or one "Variant" ans one "VariationPoint"
>
> I want constrain the model with this kind of requirements on the
> associations by the mean of the profile. It is evident that to obtain
> this result I must also use OCL constraint.
>
>
> Philippe,
>
>
> PS I try an other thing :
> In the package "block" of the SysML profile, there are three
> associations concerning "ValueType", "Dimension" and "Unit".
>
> In a very small model I try to use these objects : the result is
> exactly the result I obtain with my profile and SysML is OK. It seems
> evident that I am not using the correct method.
>
> <image>
|
|
| |
Re: Display of an association defined in a profile by an association between two stereotypes [message #1505672 is a reply to message #1503475] |
Wed, 10 December 2014 08:05 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
[Yet another accidentally off-list reply...]
Slightly easier: selectByKind eliminates one clunky OCL usage (untested)
self.base_Class.association
->one(endType
->excluding(self.base_Class)
->selectByKind(uml::Class)
->exists(extension_VariationPoint->notEmpty()))
self.base_Class.association->size() = 2
and self.base_Class.association
->forAll(endType
->selectByKind(uml::Class)
->forAll(extension_Variant->notEmpty()
or extension_VariationPoint->notEmpty()))
Regards
Ed Willink On 08/12/2014 13:59, Christian W. Damus wrote:
> Hi, Philippe,
>
> OK, now the example has associations between the stereotyped classes,
> not between the stereotypes, which is good.
>
> The support for definition of OCL constraints on stereotypes in Papyrus
> will let you do what you need. You can add a constraint to the Variant
> stereotype that is something like this (untried and untested, but some
> experimentation will find the correct formulation):
>
> self.base_Class.association->one(
> endType->excluding(self.base_Class)->exists(e |
> e.oclIsKindOf(uml::Class) and
> e.oclAsType(uml::Class).extension_VariationPoint->notEmpty()))
>
> and to the Constraint stereotype:
>
> self.base_Class.association->size() = 2 and
> self.base_Class.association->forAll(
> endType->forAll(e | e.oclIsKindOf(uml::Class) and
> (e.oclAsType(uml::Class).extension_Variant->notEmpty() or
> e.oclAsType(uml::Class).extension_VariationPoint->notEmpty())))
>
> So, even as you described them yourself, the constraints are not so much
> on the associations as on the types that are associated. :-)
>
> HTH,
>
> Christian
>
>
> On 2014-12-06 12:50:54 +0000, Philippe Revellat said:
>
>> Hi Christian,
>>
>> Thank you for your answer.
>>
>> To explain better what I am trying to do, I have create a small
>> example concerning productline :
>> - A profile with only three stereotypes extending Class : "Variant",
>> "VariationPoint" and "Constraint" an no Association.
>> - Using this profile, I have created a model with two
>> "VariationPoint", each owing two "Variant" and a "Constraint" between
>> two "Variant".
>>
>> What am I trying to do :
>>
>> I Which to be able to represent in the diagram of the model :
>>
>> - The association between the "VariationPoint" and the "Variant"with
>> this requirement :
>> A "Variant" shall own an association with a "VariationPoint" and only
>> one.
>>
>> - A "Constraint" shall own exactly two associations with two
>> "Variant", or two "VariationPoint" or one "Variant" ans one
>> "VariationPoint"
>>
>> I want constrain the model with this kind of requirements on the
>> associations by the mean of the profile. It is evident that to obtain
>> this result I must also use OCL constraint.
>>
>>
>> Philippe,
>>
>>
>> PS I try an other thing :
>> In the package "block" of the SysML profile, there are three
>> associations concerning "ValueType", "Dimension" and "Unit".
>>
>> In a very small model I try to use these objects : the result is
>> exactly the result I obtain with my profile and SysML is OK. It seems
>> evident that I am not using the correct method.
>>
>> <image>
>
>
|
|
|
Goto Forum:
Current Time: Fri Apr 26 19:13:53 GMT 2024
Powered by FUDForum. Page generated in 0.04145 seconds
|