Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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
:-)
 
Let's go to the waterfront with this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic