• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

UML 2 Class Diagram Questions

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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



Hi,

For your question 1, I can only comment that you may need to read the assignment carefully and have better understanding of a reverse auction by means such as "google" it via the Internet. Additionally, based on what you have proposed, will your design be able to handle all non-functional requirements an Architect should be concerned about?

For your question 2, I am unable to help on the StarUML as I did not use it. I am using BoUML. However, based on the forum, StartUML is a more popular tool.

For your question 3, a solid line without any arrows mean a bi-directional relationship between two classes. You may refer to "UML User Guide" or "UML Distilled" for more understanding.


Hope the above helps.

Good luck!

Merry Christmas and Happy New Year!!

Cheers!!
 
Ashwin Pai
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Scott Soo
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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



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!!
 
Ashwin Pai
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!!



A) CarModel - 3 solid lines to PartType

Thanks
Ashwin
 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ashwin Pai
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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



Hi Ronald,
I totally agree with your point. I raised this question just to understand how to implement such business rules in the class diagram. I totally agree that if its not part of the current phase usecases, it neednt be shownt in the CD!

Thanks
Ashwin
 
Scott Soo
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ashwin Pai:


A) CarModel - 3 solid lines to PartType

Thanks
Ashwin



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!
 
Ashwin Pai
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!



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!!
 
Scott Soo
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!!



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!
 
Scott Soo
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!



Hi,

Take a look at http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell/ to enhance your understanding.

Cheers!!
 
Ashwin Pai
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!!



Thanks a lot Scott!! This article really helps!!
Thanks again.

Ashwin
reply
    Bookmark Topic Watch Topic
  • New Topic