The only way to make your dream come true is to wake up.
Originally posted by Ashwin Pai:
Hi All,
I have a few questions on class diagrams.
I have a Superclass named PartType that has 3 subclasses BakePads, Suspension & BrakeDiscs.
I have another class CarModel.
I want to show the following business rule.
1 CarModel should have exactly 1 each of all 3 parts ie a car model coomprises of 1brake disc part type,1 suspension parttype and 1 brake pad part type.
I accomplished this by showing 3 associations between CarModel and PartType. The multiplicity on PartType for each of the associations is 1, and I assigned brake pad, brake disc & suspension Roles to the 3 associations.
I would appreciate if someone can validate this approach.
My 2nd questions is on naming the Associations. As per UML 2, an arrow head besides the association name indicates the direction in which the association needs to be read. I am using StarUML and I could not find a way to get this arrow head to show up. Is there a different way to tell the reader how to read the association?
My 3rd and final question is..
If I have a association between 2 classes A and B represented by a solid line without arrow heads, does it mean that A holds a reference to B and B holds a reference to A?
Thanks in advance!!
Ashwin
The only way to make your dream come true is to wake up.
Originally posted by Ashwin Pai:
Thanks Scott.
When I said i wanted someone to validate the approach in the 1st question, i meant if someone could confirm the semantics of the association ie does the 3 associations between CarModel and PartType satisfy the above said business rule.
Regards
Ashwin
Originally posted by Scott Soo:
Hi,
Which of the following do you mean:
A) CarModel - (3 solid lines to) PartType
OR
B) CarMode1 - (one solid line to) BrakePad
- (one solid line to) Suspension
- (one solid line to) BrakeDisc
Thank you.
Cheers!!
The only way to make your dream come true is to wake up.
Sun Certified Developer for the Java 2 Platform
Sun Certified Enterprise Architect for the Java Platform, Enterprise Edition 5
Originally posted by Ronald Wouters:
Also please remember that the diagram in the assignment is a Business Domain Model which, by definition, shows concepts from the Business. It is not because something appears on the business domain model that it also must appear on the Design Class Diagram which, again by definition, shows all the classes needed to fullfil the requirements stated in the use cases. In other words, in my opinion, if the use cases for the current iteration in the development lifecycle don't mention something, then I don't consider it a requirement an it can therefor be omitted from the Design class diagram for the current iteration.
But that's just me
The only way to make your dream come true is to wake up.
Originally posted by Ashwin Pai:
A) CarModel - 3 solid lines to PartType
Thanks
Ashwin
Originally posted by Scott Soo:
Hi,
If your scenario is CarModel - 3 solid line to PartType, I would think it is a bit odd to show in such form. Based on my knowledge, such case is usually done by one solid line with the multiplicity of (1 - 3) if there must only be three PartType and specify via the "{}" on the constraint that the PartType must fulfill.
Thank you!
Cheers!
The only way to make your dream come true is to wake up.
Originally posted by Ashwin Pai:
Thanks Scott! But doesnt 1-3 multiplicity indicate that CarModel has 1 or 2 or 3 PartType ? Also this would not indicate that all part types (BrakePads, BrakeDics & Suspension) are mandatory!! It just says i could have 1 to 3 PartTypes(could be 3 Suspensions) .
I am looking for a notation where I could say 1 CarModel SHOULD have exactly 1 BrakePad, 1 BrakeDisc & 1 Suspension.
Let me know!!
Originally posted by Scott Soo:
Hi,
My understanding is if you did not put 1..3, putting only 3 mean you must have 3 PartType. After which, you can put constraint using "{}" and specify each PartType is unique. This is one of the possible ways of presenting your requirements.
Thank you.
Cheers!
Originally posted by Scott Soo:
Hi,
Take a look at http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell/ to enhance your understanding.
Cheers!!
The only way to make your dream come true is to wake up.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |