I'm trying to make a UML model with my friend and our problem is that we can only make simple diagrams and don't know how to model more complex relationships, like buying a seat in a cinema.
I think it may be too complex for us because in a cinema you have screening rooms, inside those rows, and seats. You have different movies, and they can be screened multiple times too in different rooms. And to take into account different priced tickets, as well as being able to buy multiple seats at the same time.
We are in uni and we have looked at a bunch of examples but they were so simple that it doesn't require a diagram to program or to understand them.
Description of the problem: We have a customer who would be able to buy tickets either online or at the cinema. We can't make a central system (of a single cinema) that lets the online website and the cash registers in the cinema communicate so that the customer wouldn't buy seats that are already have been sold before, we don't know how to model this in UML.
If the problem is that we are trying to do too much in 1 diagram or trying to do stuff that shouldn't be done with class diagram, please let us know how to break it up and what parts to put where because we are kinda lost at this point.
Any help is highly appriciated!
There is a difference between the static structure of an application and its dynamic behavior. A class diagram is meant to model the static structure only. It can be used to show relationships between customers and tickets and between tickets and performances, but it is not suited to reflect the process of "buying" and checking whether a seat has already been sold. This can be captured in an activity diagram (for instance).
You shouldn't connect tickets directly to movies and seats. What's missing in your class diagram are "Performance" and "Slot".
A Performance is a movie shown during a particular time in a particular room. For example, Performance 28374 is movie "Rambo 5" being shown in room 2 from 7pm till 9pm.
A Slot is a seat during a Performance, e.g. seat 12C for Performance 28374.
Now, you can relate a Ticket to a Slot. If a Slot is already bought, it is related to a Ticket. If a Slot is not yet bought, it is not related.