• 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
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

Question of prasks on UML

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An UML diagram has a rectangle representing class A is connected by a solid line and a solid (dark) diamond near class A from class B.
In Java implementation
a.Class B will have a reference to Class A
b.Class A will have a reference to Class B
c.Class B has an aggregation relationship with Class A
d.Class A has an composition relationship with Class B
They say answer a is the correct one, but I think that also d is correct.
What do you think?
 
Eduardo Cobian
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My mistake.
They say that answer b is correct. What about answer d?
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
D is not right because Class B has a composite relationship with class A
Thanks
Shankar Ranganath
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Eduardo Cobian:
My mistake.
They say that answer b is correct. What about answer d?


I have also taken this test. You have the same confusion which I had. The question is trying to differentiate between "Java Implementation ie code" and conceptual relationship. Conceptually
class A has composition relationship with B but when you code the class A it will have a reference to an instance of class B.
In fact, there is a repeat question on that test without the word "implementation" and the correct answer given is D.
Hope that helps
:-)
 
reply
    Bookmark Topic Watch Topic
  • New Topic