• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which are the ways in which a client can get a reference to an existing entity object

 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers,

Question :
Which are the ways in which a client can get a reference to an existing entity object's local component interface ?

Answer
B. Receive the reference as a parameter in a method call.

Can someone please justify this answer

Thanks
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There has to be a point - SOMEWHERE - in the flow of control for information to be passed from on part of the program to another. This is where abstracting away the fundamental operation of the machine shows a weakness as a design paradigm.

Although one could design a language such that a declaration of a reference to an object was made useable by that declaration, Java has historical origins such that auto-vivification of variables compartmentalizes to the area where the variable is declared.

To access that variable from another area of the program, you have to ask for it.

That would be called a getter method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic