Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Composite diagram(using collaboration to capture design patterns)
Composite diagram [message #1794218] Mon, 27 August 2018 15:38 Go to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 179
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 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 159
Registered: March 2011
Location: Paris Saclay, France
Senior Member
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 #1794303 is a reply to message #1794300] Tue, 28 August 2018 15:43 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 159
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Link was broken in my previous message
[1] https://git.eclipse.org/r/#/c/126526/
Re: Composite diagram [message #1794308 is a reply to message #1794303] Tue, 28 August 2018 17:05 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 179
Registered: October 2014
Senior Member
Thanks for you quick reply.
I am trying to create some patterns that i can use them in a specific context. I gave observer pattern as a minimal example to explain my problems.
I have created observer pattern using properties as collaborationRoles in the composite diagram but i had to create classes to give them a role of subject and role of observer.
1- Did you mean that properties don't need to be given type and then hide their types?
2- For collaborationUse i have the same problem as i tried to use properties but i need to give them types. Also i used alternative solution for the collaboration use that created classes instead of properties but papyrus didn't allow me to create connector between them.So how can i connect classes together.For example if i have more classes and each class plays a role and they have associations between them then i need to create connectors between those classes as instances of the associations.

Can you please help me. Attached observer example
  • Attachment: observer.zip
    (Size: 6.02KB, Downloaded 6 times)

[Updated on: Tue, 28 August 2018 17:08]

Report message to a moderator

Re: Composite diagram [message #1794360 is a reply to message #1794308] Wed, 29 August 2018 14:45 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 159
Registered: March 2011
Location: Paris Saclay, France
Senior Member
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 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 179
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 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 159
Registered: March 2011
Location: Paris Saclay, France
Senior Member
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.
Re: Composite diagram [message #1794514 is a reply to message #1794484] Fri, 31 August 2018 16:26 Go to previous message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 179
Registered: October 2014
Senior Member
Hi Ansgar,
Thanks for your help.

Taghreed
Previous Topic:[Sequence Diagram] Cannot move Messages beneath CombinedFragment
Next Topic:SW Designer 1.1.0 release
Goto Forum:
  


Current Time: Fri Sep 21 12:20:45 GMT 2018

Powered by FUDForum. Page generated in 0.04684 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top