0% found this document useful (0 votes)
30 views2 pages

Class Diag

The document discusses different types of relationships between classes in a class diagram including association, aggregation, composition, inheritance, and realization. Association shows a connection between classes and can be one-to-one, one-to-many, or many-to-many. Aggregation defines a "has a" relationship where a class is composed of other classes. Composition is a stronger form of aggregation where classes have a life cycle dependency. Inheritance shows an "is a" relationship where a child class takes on properties of a parent class. Realization defines an interface contract that is implemented by a class.

Uploaded by

Devika Rani
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

Class Diag

The document discusses different types of relationships between classes in a class diagram including association, aggregation, composition, inheritance, and realization. Association shows a connection between classes and can be one-to-one, one-to-many, or many-to-many. Aggregation defines a "has a" relationship where a class is composed of other classes. Composition is a stronger form of aggregation where classes have a life cycle dependency. Inheritance shows an "is a" relationship where a child class takes on properties of a parent class. Realization defines an interface contract that is implemented by a class.

Uploaded by

Devika Rani
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Relationships between Classes

In a class diagram, obviously you can't have classes just floating around; you need to see the relationship between them. The following table shows the kinds of relationships between classes, their notation, and what they mean.

Sr. No. 1

Relation

Symbol

Description

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:

1 a.

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).

1 b.

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.

1 c.

Reflexive Association

No separate symbol. However, the relation will point back at the same class.

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. 2 Aggregation 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. 2 a. Composition Composition is a variation of the aggregation relationship. Composition connotes that a strong life cycle is associated between the classes. 3 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. 4 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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy