Professional Documents
Culture Documents
joins
• Example:
• Example:
• Same type of entity (User & Customer, Vehicle and Car)
• Full effect of ownership (When parent class delete effect comes on child
class)
• Objects have their own lifecycle (Objects are independently used Eg: Customer & Product)
• No ownership between entities (When one entity deletes there is no effect on other entity)
+delete-product(id: int)
Admin Customer + update-product(id: int, name : string, quantity : int, price : int)
+search-product(keyword: string)
- Name : string
- Address : string
1 Contains
+ login(username : string, password : string)
Admin Customer
1..*
- Name : string
- Address : string Product
1 Purchases 0 ..*
- id: int
+ register(username : string, - product-name : string
password : string, Name : string, - quantity: int
- price: int
Address : string)
+ add-product(name : string, quantity : int, price : int)
+delete-product(id: int)
+ update-product(id: int, name : string, quantity : int, price : int)
+search-product(keyword: string)
Cardinality association
Design class diagram for student attendance system. In the system admin
can register teachers, students after login into the system. Admin can also
create different batches and subjects related to different departments.
Teachers after login can add and view attendance of the students based
upon the selected batch. Students can view their personal attendance
after login inside the system.
User
Department Attendance
Student Teacher
Subject Batch
part of
is part of
Aggregation
Aggregation
Example
composition
Design class diagram for library management system. In the system admin user can
add, update and delete books from the library after login into the system. Students and
teachers can search and download books from the system after login into the system.
All the students and teachers can send request for addition of new books. They can
send maximum 5 requests. Admin creates accounts for the students and teachers.
Admin user can also view the list of books download by the students and teachers and
can also view the book requested by the students and teachers.
User
Student Teacher
Library Book