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.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
The classes for Mall management system are
- Mall management –
It is the class that depicts the entire shopping mall.
- Floor –
It contains the details of each floor of the shopping mall.
- Shops –
It contains the details of the shops on the respective floors
- Maintenance –
It contains the maintenance of the mall and checks whether all the cleaning activities are done. It also ensures maintenance check for the corresponding floor.
- Employee –
It contains all the employees in the mall. But there can be two types of employees like employees of the shop and employees of the mall. So this Employee class is the parent class of two child classes -> Shopkeeper and Maintenance staff.
- Shopkeeper –
Child class of Employee which contains details of shopkeeper
- Maintenance staff –
Child class of Employee which contains details of mall maintenance staff.
- Customer –
It contains the details of customers who purchased any product inside the mall.
- Electricals –
It maintains all the electricals like lift, fan, light, AC and escalator.
- Mall management – Mall name, No of floors, No of employees
- Floor – Floor number, number of shops
- Shops – Shop name, owner name, area of shop, no of employees
- Maintenance – Floor number, Maintenance incharge name, no of employees, maintenance_check
- Employee – Employee id, Employee name, Employee age, Employee salary
- Customer – Customer id, Customer name, purchased amt
- Electricals – Number of Lights, Number of fans, Number of Ac, Number of Lift, Number of Escalator.
1. Mall management :
- open() -This method is used to indicate the status of the mall by saying whether it is open or closed.
2. Floor :
- floorDetails() – This method contains all the details of the floor.
- shopStatus() – This method is used to indicate the status of all the shops in the floor, the total number of shops which are opened and no of shops being closed.
3. Shops :
- shopDetails() – This method is to describe the shop like the type of goods sold at the shop, area of the shop, prizes of the items ,etc.
- calcBill() – This method calculates the bill amount for a particular shop.
4. Maintenance :
- maintenanceDetails() – This method contains the details of the maintenance department, works done by them,etc.
- checkMaintenance() -This method is to perform maintenance checks on the mall, like cleaning the floors, inspecting the electricals, cleaning toilets, security checks,etc.
- staffDetails() -This method is used to display the details of all the employees working for maintenance.
5. Employee :
- employeeDetails() – This method contains the details of employees who are working for the shop and for the mall.
- calcSalary() – This method calculates the salary of each employee according to their designation and work done.
6. Customer :
- customerDetails() – This method displays the details of the customers, no of items they bought, no of shops in which they purchased, etc.
7. Electricals :
- eletricalsDetails() – This method displays the details of all the electricals in the mall, their working status, efficiency, etc
- calcPowerComsumption() -This method is to calculate the power consumption of each and every electricals like lift, fan, lights, air conditioners, escalators, etc.
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.