Asociation

ASSOCIATION

0  0 2016-09-02 07:16:13

Association is a relationship between two classes. In other words, association defines the multiplicity between classes. Aggregation is a special form of association and Composition is a special form of aggregation.
Association represents a relationship between two or more objects where all objects have their own lifecycle and there is no owner. it is the way that two classes are functionally connected to each other.The name of an association specifies the nature of relationship between objects. This is represented by a solid line.



It represents a relationship between two or more objects where all objects have their own lifecycle and there is no owner. The name of an association specifies the nature of relationship between objects. This is represented by a solid line.
 It is a binary association between two classes or same class.
 It is represented as a solid line between the given classes with the end part showing the ‘role’ of
 the association.
 Each association has two or more roles.
 Consider,



 

In the above example we have an association between two classes Company and Person.The name of the association is ,’worksFor’ and it is mentioned on the top of the line connecting the two classes. The roles are , ‘employee’ and ‘employer’. Thus we can read the association works For as, each Company employees Person and each Person is an employer of Company.
    
 One needs to traverse the association in one or both the directions. This is called as Navigability. The direction of navigation is shown by the arrow head.

Consider,        


 

In the above example the navigability is from the Order class to the Items class. This is a design decision which indicates that the flow will go from Order class having information/reference about the Items class but vice-versa is not possible.
 The reason for association is called as the ‘qualifier’. Consider,



In the above example classes Bank and Person are associated with each other because of or through an ‘account’. Thus account becomes the qualifier for this association.
 Multiplicity specifies the range of the associated classes. It is given in the following format, lowerbound..upperbound
Here lowerbound and upperbound are integer values which indicate the full range. ‘*’ can be used to indicate unlimited upper bound.

 

Comments (0)

Post Your Comments

Headquarter



Hong Kong Office



Find Us On

Website Development Company
SEO
Digital Marketing
website development company in Hong Kong
website designer in pune