문제

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

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top