Open In App

Class Diagram for Bus Stand Management System

A bus stand is a place where all buses will be available for transportation within a state and among other states. In this article, we’ll see about the bus stand management of a typical Indian bus stand along with its class diagram.

Classes :



Attributes:

Methods:



1. BusStandManagement : 

2. Employee:  

3. Parking:  

4. TravelAgency

5. Bus  

6. Passengers

7. Ticket  

8. Shops  

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,  

1. Driver, Conductor, MaintenanceStaff is the child class of Employee.

  • Driver is a Employee
  • Conductor is a Employee
  • MaintenanceStaff is a Employee

     It correctly satisfies “is-a” relationship

2. GovernmentAgency and PrivateAgency is the child class of TravelAgency

  • GovernmentAgency is a TravelAgency
  • PrivateAgency is a TravelAgency

It correctly satisfies “is-a” relationship

3. BusParking and VehicleParking is the child class of  Parking

  • BusParking is a Parking
  • VehicleParking is a Parking

It correctly satisfies “is-a” relationship

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,

  • BusStandManagement and Shop – Shop can exist without Bus Stand.
  • BusStandManagement  and  Parking – Parking can exist without Bus Stand.
  • BusStandManagement  and  TravelAgency – TravelAgency can exist without Bus stand.
  • Ticket and Passenger – Passenger can exist without ticket.
  • Bus  and Passenger –  Passenger can exist without Bus.

follows Aggregation relation.

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 “has-a” relationship.

Here,

  • Bus and Ticket – Ticket cannot exist without Bus

follow Composition relation.

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,

  • Employee and Passenger – Employee uses Passenger, Passenger uses Employee.

follow Association relation.

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,  

  • Passenger and shops  – Passenger uses shops

follow unidirectional Association.

Notation :

Class Diagram :


Article Tags :