permaculture playing cards*
The moose likes OO, Patterns, UML and Refactoring and the fly likes realization relationship Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "realization relationship" Watch "realization relationship" New topic
Author

realization relationship

Jayadev Pulaparty
Ranch Hand

Joined: Mar 25, 2002
Posts: 662
Hi All,
I was going through UML Distilled by Fowler and was not being able to properly interpret the realization relationship he was talking about. The following is what Fowler said in the book -
"Realization is deliberately similar to generalization; it indicates that one class implements behaviour specified by another. It is permissible for one implementation class to realize another; this means that the realizing class must conform to the interface, but need not use inheritance"

This is what i understand from his explanation, in my own words -
" A class can subclass an abstract class and thereby realize that it is implementing a particular interface, eventhough it is not in inheritance with the interface( not like -- for example classA implements interfaceXX)". Is this interpretation correct? Please correct for any mistakes. Where is this kind of realization useful?
Thanks,
Jayadev.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Here is my understanding:
- Generalization/Specialization: class conforms to the same interface and inherits implementation from the superclass
- Realization: class conforms to the interface as defined by the realized Interface, it doesn't inherit any implementation
Therefore in Java "extends" would mean Specialization for classes, Realization for interfaces; "implements" would always mean Realization.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Jayadev Pulaparty
Ranch Hand

Joined: Mar 25, 2002
Posts: 662
That was very clear explanation. Thanks.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Jayadev Pulaparty:
That was very clear explanation.

Hopefully it was also correct...
Thanks.

You're welcome!
Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
Hi,
Originally posted by Ilja Preuss:
.. Realization for interfaces; "implements" would always mean Realization.

Yups! Put another way, Realizing an interface means confirming an agreement!
Interface is a contract between interface designer and interface implementor. By implementing an interface means implementor is realizing the rules of contract. I believe there is another good word in place of rule, which is not coming in my mind right now.
Bye,
Viki.


Count the flowers of your garden, NOT the leafs which falls away!
Prepare IBM Exam 340 by joining http://groups.yahoo.com/group/IBM340Exam/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: realization relationship
 
Similar Threads
Aggregation
Realization relationship symbol?
Realization relationship -- dashed arrow or solid line?
UML diagram ?
isn't interface support inheritance