Open In App

Class diagram for Mall Management system

Class Diagram is one among the UML diagram consists of many classes and describes the attributes and relationships among various objects.  

Classes:



The classes for Mall management system are

Attributes :



Methods :  

1. Mall management :

2. Floor :

3. Shops :

4. Maintenance : 

5. Employee : 

6. Customer : 

7. Electricals : 

Relationships:

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,  
Shopkeeper and Maintenance staff class is the child class of the Employee class. 
Shopkeeper is an Employee. 
Maintenance staff is an Employee
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. It follows “has-a” relationship.

Here, 
class Maintenance and class Electricals have an aggregation relation.
Electrical can exist even without maintenance.

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, 
class Floor and class shops have composition relation, i.e., Floor has a Shop.
But the reason for this being composition is Shop cannot exist without a particular floor.

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, 
Class Floor and Class Maintenance have an association relation. 
Ie. Floor is using maintenance and maintenance is using the floor.  
In addition, class  Customer and class Employee have association relations 
I.e. Customer is using employee, employee is using customer.

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 by the relationship.

Here, class Shopkeeper and class Shops, 
class Maintenance staff and class Floor have a unidirectional association.

Notations:

Class Diagram:

Article Tags :