Composite diagram [message #1794218] |
Mon, 27 August 2018 15:38 |
taghreed altamimi Messages: 184 Registered: October 2014 |
Senior Member |
|
|
Hi,
I wanted to use collaboration to capture design patterns.Therefore i used composite diagram to be able to use Collaboration,CollaborationRole and CollaboratonUse from the tool palette .I have some questions using collaboration by Papyrus :
1- Do i have to draw class diagram first to be able to create collaborationRoles ?as Papyrus keeps showing a message says that collaborationRole should be a connectableElement which means that it should be a property therefore i had to create a class diagram has two classes (observer and subject) then use the role of the association between those classes in order to be able to create the collaborationRole. is there any trick to avoid creating class diagram and use the collaboration directly?
2- The connector between collaborationRoles has multiplicity (1 to 1) how can i delete multiplicity ? i want to follow the standard of UML2 which doesn't have multiplicity for the connector.
Note: Attached UML2 standard (section 11.7) and example of Observer collaboration
Thanks,
Taghreed
[Updated on: Mon, 27 August 2018 15:46] Report message to a moderator
|
|
|
Re: Composite diagram [message #1794300 is a reply to message #1794218] |
Tue, 28 August 2018 15:23 |
|
Hi,
concerning your first question: you need to create properties within the collaboration, but you don't need a class diagram for that. You can do that in the composite-structure diagram or via the model explorer
concerning your 2nd question: you can't delete a multiplicity, each connector has 2 or more connector ends which in turn have multiplicities (that's 100% UML conforming). However, you might want to hide them in the diagram, e.g. via shift-delete or by clicking on the connector and calling Filters -> Hide all labels
Please also note that Papyrus designer will offer some design pattern support, but the gerrit patch [1] has not been integrated yet.
Ansgar
[1] https://git.eclipse.org/r/#/c/126526/
|
|
|
|
|
Re: Composite diagram [message #1794360 is a reply to message #1794308] |
Wed, 29 August 2018 14:45 |
|
I have left properties untyped in the patterns that I modeled. The following CSS might be useful (select the diagram itself (click on its background) and add a diagram style-sheet via the "Style" tab of the property view). It assures that a Collaborations is shown as an Ellipse and hides all Property labels except the name.
Collaboration {
isOval: true;
fillcolor: #ffff99;
}
Property {
maskLabel: name;
fillcolor: white;
}
|
|
|
Re: Composite diagram [message #1794368 is a reply to message #1794360] |
Wed, 29 August 2018 15:50 |
taghreed altamimi Messages: 184 Registered: October 2014 |
Senior Member |
|
|
I cannot really thank you enough:)
I have another two questions about the collaborationUse,
1-can i create collaborationUse without compartment(class) and if no is there any trick to hide thecompartment(class) and show only the use.
2- In the collaborationUse i think that i can use untyped property to create the part which is in the observer example is Callqueue plays a role of subject so Callqueue should be instance then and it should be written small letter am i right??
by the way i applied the same style for collaborationUse and is shown now as Ellipse.
Thanks for your help
Taghreed
[Updated on: Wed, 29 August 2018 16:42] Report message to a moderator
|
|
|
Re: Composite diagram [message #1794484 is a reply to message #1794368] |
Fri, 31 August 2018 07:46 |
|
Hi,
the collaboration-use is always part of a classifier (in most cases a class) owning it. It's typically shown "within" this classifier using a composite-structure diagram. You cannot show the collaboration-use without the classifier (well, you could probably do something with colors and visible attributes, but I would not recommend it, see https://wiki.eclipse.org/MDT/Papyrus/UserGuide/CSS).
Not sure, if I understood your 2nd question. You can create a property (part) in the class that is owning the collaboration use. Whether you use small or capital letter is a question of conventions, but yes, properties are typically starting with a lower-case letter.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03097 seconds