We need to design an online Movie ticket booking system where a user can search a movie in a given city and book it.This article will explain you the architecture of the booking system.
How to implement seat booking process?
The Main Classes to be used for the user personas :
This is an OOP design question, so full code is not required. The above code has classes and attributes only. In the above code, as you can see enums are self-explanatory.
We have users class in which users details are kept.
Theater class in which name of the theater, it’s address and list of movies currently running are kept.
Booking class lets you book the seat in a particular theater. It keeps a reference in Movie, Payment class.
How to handle the cases where two persons are trying to access the same seat almost same time?
Lets take SeatBook and Transactions class which will be called from the main class. Here from the above code, We expand a bit the payment process which is not shown in the above code. In SeatBook class we will have reference to Transaction class also.
Now to ensure when two persons are trying to access the same seat almost at the same time then we would use Synchronized method of Thread class and will call a thread belong to each log in user.
- Design an online hotel booking system like OYO Rooms
- Design a Logistics System
- Design City Guide System like Foursquare
- Design an online book reader system
- Design Media Sharing Social Networking System
- Design Video Sharing Service System like Youtube
- Design data structures and algorithms for in-memory file system
- MVC Design Pattern
- Design a Hit Counter
- Bridge Design Pattern
- Visitor design pattern
- Mediator design pattern
- Builder Design Pattern
- Composite Design Pattern
- Proxy Design Pattern
- Prototype Design Pattern
- Composite Design Pattern in C++
- Memento design pattern
- Mediator Design Pattern
- State Design Pattern
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.