Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The answer to your question about the room and the wall is the answer to this question: "Can the wall exist without the room?"</p> <p>I believe your scenario is using aggregation. Can the wall exist without the room? Sure it can. One could destroy the room by destroying three walls, but that remaining wall stands on its own. I think we're down to semantics now. This answer can change depending on how <em>you</em> view the walls in <em>your</em> scenario.</p> <p>This <a href="https://softwareengineering.stackexchange.com/questions/61376/aggregation-vs-composition">link</a> shows a concise way to think about it:</p> <ol> <li>A "owns" B = <strong>Composition</strong> : B has no meaning or purpose in the system without A</li> <li>A "uses" B = <strong>Aggregation</strong> : B exists independently (conceptually) from A</li> </ol> <p>Same <a href="https://stackoverflow.com/questions/1644273/what-is-the-difference-between-aggregation-composition-and-dependency">here</a>:</p> <p><strong>Aggregation</strong> implies a relationship where the child can exist independently of the parent. Example: Class (parent) and Student (child). Delete the Class and the Students still exist.</p> <p><strong>Composition</strong> implies a relationship where the child cannot exist independent of the parent. Example: House (parent) and Room (child). Rooms don't exist separate to a House</p> <p>From <a href="http://en.wikipedia.org/wiki/Object_composition" rel="nofollow noreferrer">wikipedia</a>:</p> <p><strong>Aggregation</strong> differs from ordinary <strong>composition</strong> in that it does not imply ownership. In <strong>composition</strong>, when the owning object is destroyed, so are the contained objects. In <strong>aggregation</strong>, this is not necessarily true. For example, a university owns various departments (e.g., chemistry), and each department has a number of professors. If the university closes, the departments will no longer exist, but the professors in those departments will continue to exist. Therefore, a University can be seen as a composition of departments, whereas departments have an aggregation of professors. In addition, a Professor could work in more than one department, but a department could not be part of more than one university.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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