wood burning stoves 2.0*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Cade's Class Diagram question... Please Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Cade Watch "Cade New topic
Author

Cade's Class Diagram question... Please Help

Alex Silver
Greenhorn

Joined: Nov 08, 2004
Posts: 2
Hello everybody,

I started struggling with the part II today and when I looked at the class diagram in the Sun's SCEA book, I noticed two things:

- Address has an unidirectional association to Customer. The navigability arrow is at the customer side, meaning that the responsibility lies on the address object. Shouldn't that be the opposite? Shouldn't a customer have a collection of addresses (home, business,shipping1, shipping 2, etc.) instead of each address having a instance variable to customer? I don't get it.

- Credit card is the same; it also has an unidirectional association to Customer.


Please help!
Sudhansu Pati
Ranch Hand

Joined: Sep 23, 2003
Posts: 77
Hi Alex,

- Address has an unidirectional association to Customer. The navigability arrow is at the customer side, meaning that the responsibility lies on the address object. Shouldn't that be the opposite? Shouldn't a customer have a collection of addresses (home, business,shipping1, shipping 2, etc.) instead of each address having a instance variable to customer? I don't get it.

- Credit card is the same; it also has an unidirectional association to Customer.


Both your approach and Cade's approach is correct. You can keep customer info in a Address or you can keep Address info in a Customer. Remember you are just looking 2 classes here. When you will have 20+ classes in the class diagram, your design needs to be consistent.

Here is my recommendation - Go ahead and start the design the way you think. As you add more classes to the class diagram, some of the design choices you made earlier may be challanged and you probably will be forced to change the design again.

Good Luck.


Sudhansu<br />SCJP, SCWCD, SCBCD, SCJD, SCEA, SCDJWS
Alex Silver
Greenhorn

Joined: Nov 08, 2004
Posts: 2
Hi Sudhansu,

Thank you for your reply! I feel better now!

Alex

Originally posted by Sudhansu Pati:
Hi Alex,

- Address has an unidirectional association to Customer. The navigability arrow is at the customer side, meaning that the responsibility lies on the address object. Shouldn't that be the opposite? Shouldn't a customer have a collection of addresses (home, business,shipping1, shipping 2, etc.) instead of each address having a instance variable to customer? I don't get it.

- Credit card is the same; it also has an unidirectional association to Customer.


Both your approach and Cade's approach is correct. You can keep customer info in a Address or you can keep Address info in a Customer. Remember you are just looking 2 classes here. When you will have 20+ classes in the class diagram, your design needs to be consistent.

Here is my recommendation - Go ahead and start the design the way you think. As you add more classes to the class diagram, some of the design choices you made earlier may be challanged and you probably will be forced to change the design again.

Good Luck.
Joseph Zhou
Ranch Hand

Joined: Aug 01, 2000
Posts: 129
I also have a question about Cade's class diagram, there is an unidirectional association from Product to ProductCategories. if that is the case, how can we make product search in the ProductCategories? I also confused with the name ProductCategories and the multiplicity many-to-many, if ProductCategories reprentes a set of structured categories, it seems no need to be many-to-many.
 
GeeCON Prague 2014
 
subject: Cade's Class Diagram question... Please Help