Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UML Doubt

 
Bobby Sh
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In SCEA FOR J2EE (PAUL ALLEN AND JOSEPH BAMBARA) , I found the following question

In a class diagram, what does a line with an arrow from one class to another denote ?

A. Attribute visibility
B. Class visibility
C. Method visibility
D. Global visibility

Answer is A.

But my understanding is when we join a class to other class with a line, that means Class visibility. Also Attribute and Method
visibility should be based on the access specifiers (private, public..etc).

Please let me know if this understanding is not correct

Thanks & Regards
Rajnish
 
Diego Amicabile
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found an explanation for that under

http://hakata.mt.cs.cmu.edu/20-783/Slides/08_Elaboration_6.ppt

Sending messages requires visibility : a reference or pointer to the receiving object
�For an object A to send a message to an object B, B must be visible to A.�

Ways in which A can have visibility into B:
Attribute Visibility: B is an attribute of A
Parameter Visibility: is a parameter of a method of A
Local Visibility: B is a (non-parameter) local object in a method of A
Global visibility: B is in some way globally visible

so if B is associated to A, there is obviously attribute visibility. Not intuitive.

Regards
 
Mohamed Raffi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The line with an arrow depicts association relationship.
Association represents the attributes that are not simple (String, Integer, etc) and are Complex Objects.
During implementation these associated objects will be captured as attributes inside the Class from where the arrow starts.

Refer the "Value Objects and Reference Objects" Section in UML Distilled by Martin Flower and
Have a look at the following Link
http://www.comptechdoc.org/independent/uml/begin/umldcd.html

Hope that helps :-)
Raffi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic