Using collections/containers/catalogs in Domain Models

Posted by devoured elysium on Stack Overflow See other posts from Stack Overflow or by devoured elysium
Published on 2010-06-10T02:49:33Z Indexed on 2010/06/10 2:52 UTC
Read the original article Hit count: 277

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? alt text
  • Should the Cinema class concept have an association with a catalog of the 7 rooms? alt text

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

© Stack Overflow or respective owner

Related posts about c#

Related posts about java