Question

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.

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:

  1. Tickets to sell (today).
  2. Tickets already sold (today)
  3. Customers in the Cinema database
  4. The set of hours at which there are movies playing in a given room in the cinema.
  5. 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

Was it helpful?

Solution

What is the role of Room Catalog?

Does it have other attributes/operations, or is it only acting as a container for Rooms?

Can you forsee creating multiple Room Catalogs associated with and over the lifetime of the Cinema instances?

Room Catalog kind of sounds to be more like something that you'd see in a the service layer and not in a domain model.

If it's not contributing structurally or behaviorally then I'd probably cull it and go with a simple association.

OTHER TIPS

There is no correct design or wrong design in the software development industry. You can use either first or second method (i.e. you can use either catalog or connect them directly to the Cinema). But importantly you should be able to justify your design.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top