Association/Aggregation/Composition/Generalization simple example

Association

Relationship between two objects (one to one, one to many, many to many etc)

Aggregation

Aggregation is a kind of association, which refers Has a relationships.

Example: Building has a room

 Composition

It is a kind of Aggregation but when an object contains another object the contained object cannot exists without the container object
Example: Room cannot exist without building

Generalization

Generalization refers to Is a relation ship (Inheritance)
Example, Car is a Vehicle, Bus is a Vehicle

 

No comments:

Post a Comment

Model Context Protocol (MCP) — Complete Guide for Backend Engineers

  Model Context Protocol (MCP) — Complete Guide for Backend Engineers Build Tools, Resources, and AI-Driven Services Using LangChain Moder...

Featured Posts