Search code examples
classumlclass-diagram

Cinema Booking System Class Diagram Design


enter image description here

Hello all!

I have a question about where should the seats be assigned to keep track if it's booked for a showtime. There is currently two way i thought of.
1) Assign the seats to the showtime instead of cinema. However this means that for each showtime it may have a different number of seats( which should not be true).
2) Check if the seat is assigned by accessing moviergoer->booking-> movieticket->seat number. This method is tedious and uses more processing time. But i feel it's the right way as it will mean that the seats will be fixed.

I'm sorry if any other part of my diagram is wrongly drawn. However please guide me through this main question! I will be glad to get feedback for other part of my diagram too. I really hope to learn more from this scenario.


Solution

  • Your design seems ok so far. Just a few observations:

    • you should remove the navigation in general since it does not add much value
    • the association from Booking to ShowTime seems superfluous as the Ticket already holds the needed information
    • re-think about duplicating cinema/movie:string in ShowTime as it adds unwanted redundancy
    • why do you have a <<use>> iso. an association in Review?

    A seat is related to the cinema and the cinema offers show times. So 1) is ok.

    Edit: You would map the ticket like this:

    enter image description here

    The both ID roles would map the ids in ShowTime and Seat. I would use an artificial integer for the seatID and likely some HHMM format for the showTimeID.