[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.mdt.uml2.ocl] Re: Using OCL to specify derived References (NOT attributes)

Jürgen,

Sorry, the documentation is sparse right now - most of these lists are 
typically referenced by generated code that developers don't tend to look at 
that frequently...

More comments below.

Kenn

"JG" <jguni@xxxxxx> wrote in message news:el1hb0$d9v$1@xxxxxxxxxxxxxxxxxxxx
> Okay, I should have stayed with the DerivedSubsetEObjectEList as you
> suggested... when I use it, everything behaves as expected, e.g., when I
> add a column to a table, the column also shows up in the "content" List
> of the namespace (Table is a Namespace) and vice versa. So this just
> makes me wonder what the SupersetSuperset...ELists are actually there
> for. And what is the purpose of DerivedEObjectEList
>

Yes, I believe you'll want to use DerivedSubsetEObjectEList because you want 
the elements to be contained by the superset list and referenced by the 
subset list. DerivedEObjectEList is a more abstract derived list that could 
support multiple source features (instead of a single superset feature) but 
isn't changeable. A common use of this kind of list in UML is to support 
derived unions - read-only features whose values consist of the values of 
other features.

> When I used, e.g., SubsetSupersetEObjectWithInverseEList, if I add a
> column via the getColumns() EList, it shows up both in the content and
> ain the columns EList. If I add a Column to the columns EList, it
> doesn't show up. So is it meant to be used if a referenced object is not
> part of a subset by virtue of its type, but by explicit adding?
>

Yes exactly. The SubsetSupersetEObject*List classes are for support of 
non-derived subsets/supersets - the UML2 code generator provides complete 
support for these kind of subsets/supersets.

> If I observed correctly, the sourceFeatureIds must always point to the
> root reference of the derivation hierarchy, i.e., a sourceFeature must
> not itself be implemented by a DerivedSubsetEObjectEList.
>

Hmm, I'm not sure that's necessarily true (at least that wasn't the 
intention). It's more efficient for the derived list to be a "flat" 
structure (i.e. to reference the non-derived "leaves" directly), but I think 
cascading should be supported.

>
>
> Regards
>
> Jürgen
>
>