[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.modeling.mdt.uml2.ocl] Re: How to validate uniqueness of class names within an entire package subtree
|
Hi, Andy,
I'm glad it works! And, yes, allInstances() is very powerful. It computes
the set of all instances of a metaclass (including its specializations) in
the model (in EMF terms, the resource).
allNamespaces() is defined by the spec as an "additional operation". You
won't find it in the class diagrams, but under the "Additional Operations"
heading (below "Constraints") of the NamedElement description, section
7.3.2. The main purpose of these additional operations is to serve in the
formulation of constraints :-)
And that's a good point about self.base_Package ... I forgot that you're
working in a stereotype context.
Cheers,
Christian
Andreas Maier wrote:
>
> Works like hell ... OCL is so sweet :-) (I used
> "includes(self.base_Package)" instead of "includes(self)", to be more
> portable.)
>
> I was not consciously aware yet of the context propagation used several
> times here, nor of the possibility to start an expression with a
> metaclass name. This opens some new perspectives for me. Thanks for this
> example!
>
> One more question: I did not find allNamespaces() in the OCL 2.0 spec.
> Is this an extension in the OCL of Eclipse ?
>
> Andy
<snip>