Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><em>Bob Horn</em> made a point here, when a wall can exist independently from the room it has to be an aggregation.</p> <p>But remember that you model how you want to see / manipulate them, so you can also decide that you mainly care about your rooms and see the walls as a side effect of the room, then this is a composition.</p> <p><strong>Aggregation model</strong></p> <p>You build the wall and that defines your rooms, your room is the just the space between the walls.</p> <p>Thinking that way, the room does not need to have 4 walls, it's just an arbitrary set of walls: an open room can have 3 walls and a L shapes closed room might have 6.</p> <p>This is the representation an architect or a builder will adopt.</p> <p><strong>Composition model</strong></p> <p>You want to see a room as a space with walls, then what you really care about is the view of the wall from the inside side of the room. In that case you do not car if the other room has a common wall, when you destroy your room, the inside side of the wall disappears with it.</p> <p>A shared wall becomes an aggregation of two room-walls.</p> <p>This might be the correct representation if you are planning an exhibition and want define where paintings will be placed.</p> <p><strong>Model what best fit your needs</strong></p> <p>In the end you model a representation and thus a simplification. Similarly there is no <em>correct</em> or <em>best</em> answer when modeling your representation, you should model your representation after your needs.</p> <p>If you want to buy a car you tend to define book as composed of its pages, when you dispose it you dispose every pages. If you want to print a book you tend to spare parts you as aggregating folios composed of pages, if a folio is misprinted you can take another from the stock to assemble to final book.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload