Design a movie ticket booking system like Bookmyshow

We need to design an online Movie ticket booking system where a user can search for a movie in a given city and book it. This article will explain to you the architecture and implementation of the booking system.

Designing-movie-ticket-booking-system-like-Bookmyshow

Table of Content

Requirements of a movie ticket booking system

How do we implement the seat booking process?

Let us see how we can implement the seat booking process. The Main Classes to be used for the users are:

  1. User
  2. Movie
  3. Theater
  4. Booking
  5. Address
  6. Facilities

This is the pseudo implementation of the above logic. The above code has classes and attributes only. As you can see enums are self-explanatory.

Below is the explanation of the classes used in the above code:

How to handle those cases where more than one person tries to access the same seat simultaneously?

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. Let us see how it works: