Class Diagram for the Movie Ticket Booking System
Learn to create a class diagram for the movie ticket booking system using the bottom-up approach.
In this lesson, we will identify and design the Movie Ticket Booking system's key classes, abstract classes, and interfaces. Our approach follows the bottom-up design methodology, beginning with core entities and building up to system-wide relationships, as defined in the requirements lesson.
Components of a movie ticket booking system
We use a bottom-up approach, starting from core entities and relationships, ensuring the design aligns with functional and operational requirements.
Seat
The Seat
class represents a physical seat in a cinema hall. It is an abstract class extended by three concrete seat types: Silver
, Gold
, and Platinum
.
Each seat type has a fixed cost (rate).
The base
Seat
class defines the rate attribute and methods and may be overridden in subclasses if necessary.Each seat also has a seat number and a seat status (available, booked, or reserved).
The visual representation of these classes is as follows:
Show time
The ShowTime
class represents a particular show of a movie.
It contains the start time, date, and a reference to the movie being shown.
ShowTime also maintains a mapping for seat statuses for that particular show.
Here is what the class definition looks like:
Hall
The Hall
class represents a cinema hall.
Each Hall has a unique ID, a list of all seats (physical seats in the hall).
Hall manages which show is playing and which seats are available for each show.
The UML representation of the class is shown below:
Cinema
The Cinema
class consists of the number of halls present in the cinema along with the city in which it is located and an id attribute to identify the cinema in that particular city.
The class representation of the Cinema
class is as follows:
City
The City
class includes the name of the city, the state it is located in, and its zip code. In addition, it includes a list of all the cinemas available in the city.
The UML representation of the class is shown below:
Movie
The Movie
class contains all the various details of a particular movie, such as the title, genre, language, and release date. It is also composed of a list of running shows.
Here is what the class definition looks like:
Movie ticket
The MovieTicket
class refers to a customer’s ticket for a particular movie with a ticketID
as its unique identifier. It describes the details of the seat in the hall and the movie for which the ticket was bought, along with the show details.
The class ...