Using collections/containers/catalogs in Domain Models
- by devoured elysium
Let's say I want to model a cinema. The cinema will have a couple of rooms(for example, 7), where the movies are being played.
I wonder how should I design the domain model for this scenario.
Should the Cinema class concept concept have a direct association with the 7 rooms?
Should the Cinema class concept have an association with a catalog of the 7 rooms?
Why?
I am having some trouble understanding why in some places I see the first case and in some others I see something like the second case.
If instead of rooms, I wanted to depict the relationship between Cinema and:
Tickets to sell (today).
Tickets already sold (today)
Customers in the Cinema database
The set of hours at which there are movies playing in a given room in the cinema.
The set of places you can sit at in a room in the cinema.
Should I use catalogs, should I connect them directly to the Cinema concept with a multiplicity of * in the target?
Thanks