|
Re: Create containers [message #1756111 is a reply to message #1756101] |
Sat, 11 March 2017 14:10 |
Camille Letavernier Messages: 952 Registered: February 2011 |
Senior Member |
|
|
Hi,
Stereotype instances can't (Or "shouldn't?" I'm not 100% sure) contain each other. So, aggregation associations between two Stereotypes are not allowed (Or discouraged; once again, I'm not sure).
Instead, your Stereotypes should extend 2 UML Metaclasses which already define a containment relationship to each other. For example, "Zoo" extends Package, and "Animal" extends Class.
The Package - Class relationship is quite limited, so usually I would recommend using "Class" and "Property" instead (i.e. similar to what is done for Component or Composite structures, or Blocks/Internal Blocks in SysML...). The benefit of Class/Property is that a property can be typed by a Class, allowing deeper recursion of ownership. It probably isn't necessary for such a simple example, but on real world applications, it's often required.
HTH,
Camille
Camille Letavernier
|
|
|
|
Re: Create containers [message #1756158 is a reply to message #1756124] |
Mon, 13 March 2017 09:42 |
|
Hi when you create a profile you have to do a projection of a metamodel into UML. Composition Link must be supported by the metamodel of UML.
For example container - contained : in stereotype world could be based on package and classes.
For a reuse, Classes by using properties .
So I think that your problem is a problem of projection of your metamodel in UML: what will be my base metaclasses?
Patrick
|
|
|
|
|
Re: Create containers [message #1756349 is a reply to message #1756165] |
Wed, 15 March 2017 17:10 |
Athanasios Zolotas Messages: 52 Registered: November 2016 Location: York |
Member |
|
|
I followed your suggestions and now my container element extends the Profile metaclass and the contents extend the Class metaclass. I can place the latter inside the former. However, when it comes to custom shapes there's a slight problem. More specifically, if I create a custom SVG symbol for my package (let's say a simple rectangle SVG) this is placed in a compartment which is beneath the compartment that acts as the container in the package. So, visually the contained classes are not inside but above the SVG symbol that supposedly represents the container.
First of all, could you please tell me if my understanding is correct, i.e., the symbol compartment and the contents compartment are two different things one beneath the other?
Secondly, if this is the case, I know that it is possible to set "placeholders" in the SVG shape to dictate Papyrus where to place the labels (if I recall correctly this is done via an invisible shape inside the symbol that has the id "PapyrusLabel"). Is there any way to say to Papyrus where to place the contained elements in the SVG so they're are moved to the symbol compartment and not the default one?
[Updated on: Wed, 15 March 2017 17:19] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04935 seconds