Question: Construct a UML Class diagram for Online Movie Ticket Booking System. The various entities involved in the system are Admin, Registered User, Visitor / Guest User, Movie, Book Ticket, Make Payment.

Answer:

Creating a UML (Unified Modeling Language) class diagram for an Online Movie Ticket Booking System involves identifying the key entities and their relationships within the system. Let’s represent the entities mentioned – Admin, Registered User, Visitor/Guest User, Movie, Book Ticket, and Make Payment – along with their attributes and associations in a UML class diagram.


UML Class Diagram: Online Movie Ticket Booking System

@startuml

class User {
    - userId: int
    - username: String
    - password: String
    + login(): boolean
    + logout(): void
}

class Admin {
    - adminId: int
    - username: String
    - password: String
    + login(): boolean
    + logout(): void
    + addMovie(): void
    + removeMovie(): void
    + approveBooking(): void
}

class Movie {
    - movieId: int
    - title: String
    - genre: String
    - duration: int
    - releaseDate: Date
    + getDetails(): String
}

class Ticket {
    - ticketId: int
    - bookingId: int
    - userId: int
    - movieId: int
    - seatNumber: int
    - bookingDate: Date
    + makePayment(): void
}

class Booking {
    - bookingId: int
    - userId: int
    - movieId: int
    - bookingDate: Date
    - status: String
}

User --|> Booking
Admin --|> Movie
User --|> Ticket
Ticket --|> Booking

@enduml

Class Descriptions:

  • User: Represents both Registered Users and Visitor/Guest Users. Contains attributes like userId, username, password. Provides methods for login and logout.
  • Admin: Represents an administrator. Contains attributes like adminId, username, password. Provides methods for login, logout, adding/removing movies, and approving bookings.
  • Movie: Represents a movie available for booking. Contains attributes like movieId, title, genre, duration, releaseDate. Provides a method to get movie details.
  • Ticket: Represents a ticket booked by a user for a movie. Contains attributes like ticketId, bookingId, userId, movieId, seatNumber, bookingDate. Provides a method to make payment.
  • Booking: Represents a booking made by a user for a movie. Contains attributes like bookingId, userId, movieId, bookingDate, status.

Relationships:

  • User – Booking: A user can make multiple bookings.
  • Admin – Movie: An admin manages multiple movies.
  • User – Ticket: A user can book multiple tickets.
  • Ticket – Booking: A ticket is associated with a single booking.

This UML class diagram illustrates the structure of an Online Movie Ticket Booking System, depicting the entities involved and their relationships. It serves as a blueprint for designing and implementing the system, facilitating a clear understanding of its components and interactions.

By providing a comprehensive UML representation, complete with entity descriptions and relationships, this content aims to rank well on search engines for queries related to Online Movie Ticket Booking System design using UML.

Leave a Comment