Mock tests, Interview questions, Tutorials and Tech news
 
 
Home > Programming / tutorials > Relationships in UML explained

Relationships in UML explained

November 24th, 2009 Vinay Leave a comment Go to comments

The following table shows the kinds of UML relationships between classes, their notation, and what they mean

Association : When two classes are connected to each other in any way, an association relation is established. For example A “student studies in a college” association can be shown as:

association Relationhsip

association Relationhsip

Multiplicity : An example of this kind of association is many students belonging to the same college. Hence, the relation shows a star sign near the student class (one to many, many to many, and so forth kind of relations).

Directed Association : Association between classes is bi-directional by default. You can define the flow of the association by using a directed association. The arrowhead identifies the container-contained relationship

Directed Association

Directed Association

Reflexive Association : An example of this kind of relation is when a class has a variety of responsibilities. For example, an employee of a college can be a professor, a housekeeper, or an administrative assistant

Aggregation : It is kind of association that specifies a whole/part relationship between the aggregate (whole) and a component part. When a class is formed as a collection of other classes, it is called an aggregation relationship between these classes. It is also called a “has a” relationship.

aggregation

aggregation

Composition : Composition is a variation of the aggregation relationship. Composition connotes that a strong life cycle is associated between the classes.

Composition

Composition

Inheritance/Generalization : Also called an “is a” relationship, because the child class is a type of the parent class. Generalization is the basic type of relationship used to define reusable elements in the class diagram. Literally, the child classes “inherit” the common functionality defined in the parent class.

Inheritance - Generalization

Inheritance - Generalization

Realization : In a realization relationship, one entity (normally an interface) defines a set of functionalities as a contract and the other entity (normally a class) “realizes” the contract by implementing the functionality defined in the contract.

Realization

Realization

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • IndianPad
  • Reddit
Categories: Programming / tutorials Tags: ,
  1. No comments yet.
  1. No trackbacks yet.
Get Adobe Flash playerPlugin by wpburn.com wordpress themes