Open In App

Class Diagram for College Management System

Class Diagram is the way to represent the relationship between the classes. In this article, we will see about the class diagram for the College Management system.

Classes :



Attributes :

Methods :



1. CollegeManagement :

2. Department :  

3. Student :

4. Staff :

5. Classroom :

6. Canteen :

7. Library :   

8. Bus :   

9. Hostel :

10. Parking :

11. Auditorium:  

Relationship :

1. Inheritance :

          Inheritance is the practice of acquiring the required properties from one class to another class. The class which acquires the properties is known as the child class. The class which allows its properties to be acquired is known as the parent class. It is simply known as the Parent-child relationship. Ie. “Is-a” relationships

Here, the below classes follow inheritance

  • Student – UGStudent and PGStudent
  • Staff – TeachingStaff and NonTeachingStaff
  • Hostel – BoysHostel and GirlsHostel

Student – UG Student and PG Student :

UG Student and PG student are child classes of students and UG is a student and PG student is a student.

Staff – Teaching staff and Non teaching staff :

Teaching staff and Non teaching staff are child classes of Staff. Teaching staff is a staff and Non-teaching staff is also a staff.

Hostel – BoysHostel and GirlsHostel :

BoysHostel and GirlsHostel are child classes of hostels. BoysHostel is a hostel and GirlsHostel is a hostel.

2. Aggregation :

In Aggregation, Class A and Class B are dependent on each other which indicates that A has an instance of B and B has an instance of B, but they are not physically contained inside each other. In simple terms, Class B can exist without  Class A. It follows “has-a” relationship.  

Here, the below classes follow aggregation,

  • College management and hostel
  • College management and parking.

They follow aggregation because the hostel and parking can exist without College.

3. Composition :

In composition, Class A and Class B are dependent on each other which indicates that class A has an instance of class B inside class A. In other words, class B is physically contained inside class A.  So class B cannot exist without class A. It follows a “has-a” relationship.

Here,

  • College management and department
  • College management and auditorium
  • College management and classroom

follows composition.

Because the department, auditorium and classroom cannot exist without college management and are physically composed inside the college management.

4. Association :

In Association, one class is not committed to the other class in any means, but both of the classes use each other and function in their own respective spaces. It follows the “using” relation.

Here,

  • Student and staff

follow association because the student uses staff and the staff uses students

5. Unidirectional Association :

In unidirectional Association, two classes are related in some ways, but only one class makes use of the other class whereas the other class is not benefited from the relationship. Class A can call Class B whereas Class B cannot call Class A.

Here,  

  • Student and Classroom
  • Student and Library
  • Teachers and Library
  • Student and Bus
  • Student and Auditorium
  • Student and Canteen

 follows unidirectional association because the classroom , library, bus, auditorium and Canteen are being used by students whereas on the other hand classroom, library, bus, auditorium and Canteen are not benefited by the relationship with students. So they follow unidirectional association.

Notations :

Class Diagram :


Article Tags :