ElementSet vs. Array

Subject: Use a special array-like class “ElementSet” with the following properties:

Dependencies:

A1. ElementSet: + nice notation for calling methods of elements (.) + nice notation for adding/removing elements from a model element

(e.myelements << newel; e.myelements.delete newel)

A2. Array: + a separate operator like >> makes calling methods of elements more explicit + very easy to implement + easy to understand by users (no “magic” going on)

Decision: (2006-06-08) A2. Array Simplicity of implementation and ease of use are more important than a nice notation

Metamodel Many Assoc API

Subject: How to implement the API to deal with to-many associations of model elements. One option is an array like object which is held by the model element for each to-many association and which is given to the user for modification (external array). The other option is an internal array which is only accessed via add and remove methods

Dependencies: If an external array is used, this array must check the association’s constraints and register/unregister with the other side of the association. (see ElementSet vs. Array)

A1.External Array + nice API (e.myassocs << newel; e. myassocs.delete newel) + this is a Rails like API

A2.Internal Array + easy to understand for non Ruby/Rails aware users + simple implementation

Decision: (2006-06-09) A2. Internal Array Simplicity of implementation and ease of use are more important than a nice notation