• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Cade Class Diagram Question

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

While reviewing the class diagram in Cade's SCEA Study Guide in the case study (pg. 169):

Regarding the association between the classes Customer and CreditCard - why is the navigation arrow pointing towards Customer? Shouldn't the arrow point the other way (i.e. Customer has a reference to CreditCard). Why would the CreditCard class need a reference to Customer?
[ June 06, 2004: Message edited by: PETER BERGOFF ]
 
Peter Bergoff
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anyone have an opinion on this?
 
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I also have the same doubt.
In the class diagram I modeled I inserted a navigation arrow pointing from Customer to CreditCard. In Customer there's an attribute (type Collection, because a customer may own several credit cards) that makes a reference to CreditCard.
In this case I choosed 'Composition', because if customer is excluded from the system, his credit card information will be too. The black diamond keeps aside class Customer.
 
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Peter & Luciano,
In my opinion, Cade should not be showing navigation in a 'conceptual' class diagram (also should not show session beans). If you remove the navigation, you remove the problem.

Navigation is something to consider during the creation of 'specification' and 'implementation' class diagrams, during analysis and design. Remember, for this exam we are looking at architectual diagrams.

Read 'UML Distilled' by Mark Fowler, page 55, 4th paragragh.

Ray
SCJP, SCWCD, SCBCD, SCEA (part-1), IBM-484, IBM-486
 
Peter Bergoff
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Ramon,

You may have a point - however Cade (which is the only official example of the part 2 solution I've seen) does use navigation.
 
Ramon Gill
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Peter,
Forgetting the 'class' arguments about direction, I'll try to answer your question.
creditCard navigates to Customer (and not the other way round) because within the system being developed, there is no requirement to ever find out what credit cards a customer has. However, there is is a need to find out who the customer is when a credit card number is entered into the system.

Ray
 
Luciano Queiroz
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I disagree with you.
When the Customer pays the itinerary, the system exhibits a list of credit cards (case the Customer owns more than 1 credit card) and the Customer selects one credit card to carry out the payment.
So, the system needs to know which credit cards a Customer has.
 
Ramon Gill
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Luciano,
My answer is theoretical, not based on the use cases. I was trying to show an example that reflected Cade's class diagram.

I still feel navigation should not be shown on conceptual class diagrams. Both Fowler and Larmen say the same thing. Navigation can be added once you drill down into analysis and design. You mentioned earlier that a customer has a 'collection' of credit cards. To me this is an implementation level class diagram. I feel we should be looking at conceptual level class diagrams for the exam.

As plenty of people must have copied Cade for the exams, there is obviously a lot of scope in what is allowed for a class diagram. Navigation is probably acceptable by the markers.

Ray
 
Peter Bergoff
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Back to the original question:

Is the Cade Class diagram incorrect in regards to the use of navigation?
If not, why?
 
I found some pretty shells, some sea glass and this lovely tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic