DEV Community

Cover image for Parking Lot Design
Amit Kumar Sahu
Amit Kumar Sahu

Posted on

1 1

Parking Lot Design

Hello Friends !!! Well, this is my first technical blog. I welcome the readers to share their feedback which can help me to improve ahead. I appreciate your time and response to this post. Any questions are Welcome!

Process Brief :

This is a Parking lot system designed using object oriented principles in Python.

The objects in my design are ParkingLot, Levels, Slots and Vehicle.

Following objects has been considered in the design:

• ParkingLot - A parking lot is made up of 'n' number of levels/floors and 'm' number of slots per floor.

• Levels - Each level is an independent entity with a floor number, its lanes and the slots within it. The number of lanes are designed based on the number of slots. 10 slots make one lane.

• Slots - The slots are considered as the independent entities to each other where in the type of the vehicle is considered to fill the slot.

• Vehicles - Object with plate no., company name and their type. A vehicle has the attributes of license plate and the company it is from.

I have considered Levels and Slots as entities that are independent so that any level can be added with a desired number of spots later.Each time a vehicle comes in or goes out, a list of vehicles for the particular company is updated. Also the available spots are updated in the particular level.

Methods:

ParkVehicle - This operation inserts a vehicle accordingly, also takes care of what company vehicle it is.

Leave Operation - This operations exits a vehicle 'C' in a level 'm'.

CompanyParked - This operation allows the user to view the list of vehicles parked for a particular company.

Link below :

https://github.com/nikuamit/ParkingLot

Top comments (1)

Collapse
 
nishimotos93047 profile image
Nishimotoson Kirven

The design of a parking lot system using object-oriented principles in Python demonstrates an efficient and scalable approach to managing parking spaces and vehicle data. The system includes objects like ParkingLot, Levels, Slots, and Vehicles, enabling flexibility in adding levels or slots dynamically. Features like ParkVehicle ensure vehicles are parked based on their type and company, while LeaveOperation handles exits and updates available spots. Additionally, the CompanyParked method tracks vehicles for specific companies, offering real-time visibility. Tools like R2Park exemplify how such designs can integrate into real-world applications, enabling seamless vehicle registration and parking management, making parking systems smarter and user-friendly.