Generalization problem [message #1782031] |
Fri, 16 February 2018 09:48 |
Eduardo Gutierrez Messages: 48 Registered: December 2017 |
Member |
|
|
Hello, i need to design a UML class diagram, with one object as parent ( payment class with quantity, id, date) and three diferent "sons" ( credit card with own attributes number of card, and expire date, a paypal method which i need the paypal account, and cash method).
So i need a generalization set of the three sons, and mark as disjoint, complete.
Ive been googleing and make lots of test but i can get whith it...any idea, link or step by step instructions would be nice.
In case that papyrus doesnt support this, i make the suggestion as is very usual to have three or 4 sons of a parent class using inheritnace in Java ( generalization in UML).
|
|
|
|
|
|
Re: Generalization problem [message #1782072 is a reply to message #1782031] |
Fri, 16 February 2018 18:21 |
|
Hi Eduardo,
sorry I overread you asked for step by step instruction.
OK, here it is:
Accordung to the OMG UML 2.5.x specification chapter 9.9.8 "GeneralizationSet [Class]" subclause 5 a GeneralizationSet owns Generalization associations as assciation ends. As Papyrus strictly adheres to the OMG UML 2.5.x specification this gives you a hint how to specify a GeneralizationSet.
As a GeneralizationSet refers to Generalization associations, you simply pick the Generalization associations out of the palette and draw a virtual line starting at the first Generalization association and ends at the second Generalization association.
This results in
To add further Generalization associations to the GeneralizationSet is a little more tricky.
As you see in the screen shot above a GeneralizationSet has a properties view, the properties view itself has an "Advanced" tab. Wtithin the advanced tab a attribute "Generalization Set" exists. At the right side end of the "Generalization Set" attribute line you'll see three dots, click on these three dots to select the GeneralizationSet the Generalization should be added to.
That's all.
/pica
|
|
|
Re: Generalization problem [message #1782102 is a reply to message #1782037] |
Sat, 17 February 2018 16:30 |
|
Hi Ed,
I interpret
that way.
1. The GeneralizationSet is incomplete, it does not meet the Liskov criteria.
2. The GeneralizationSet is disjoint, an instance of the classes within the GeneralizationSet may not be also an instance of another class within by the GeneralizationSet (e.g. an instance of MeansOfTransportation may not be a Bicycle and also a Plane)
Well, a sane model shall ensure
1. the Liskov criteria is always met
2. classes are disjoint
As a result I regard the GeneralizationSet as a means to indicate technical debt ;-)
/pica
[Updated on: Sat, 17 February 2018 16:32] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: Generalization problem [message #1782190 is a reply to message #1782139] |
Tue, 20 February 2018 10:29 |
|
Hi Eduardo,
Hi Ed,
I guess Eduardo simply mixed up the terms class and operation. Neither class or operation in the diagram Eduardo attached seems to be marked abstract as no name is rendered in italics.
I personally would mark the parent class Empleats abstract, simply to ensure it nevers gets instanciated.
/Carsten
|
|
|
|
Powered by
FUDForum. Page generated in 0.04288 seconds