Re: Re[2]: asking about OCL



Re: Re[2]: asking about OCL

From: Pieter Van Gorp <pieter_at_pietervangorp.com>
Date: Wed, 17 May 2006 10:35:35 +0200
Message-ID: <15af5f050605170135o764cfebehb5314dc63ed31626@mail.gmail.com>
Hi John,

On 5/17/06, John Daniels <jd@syntropy.co.uk> wrote:
> Our solution, expressed in today's
> UML terms, was to place a type in the model, called the "initial type"
> and denoted by a stereotype, that has exactly one instance and
> represents the model itself. All other instances can be navigated from
> this initial instance
In a UML context, I use the outermost Namespace instance for this
purpose.  In MagicDraw, this always happens to be an instance of the
UML Model metaclass.  I haven't checked the UML spec whether MagicDraw
is required to recursively embed all elments in such an instance of
Model but a lot of tools seem to follow this practice (as they all
have a tree-view on the available model elements and the root of that
tree is usually of type Model).  Obtaining all other elements from
this instance can be implemented with a transitive closure pattern on
the "ownedElements" property (see the "allTransParts" helper in
http://www.fots.ua.ac.be/~pvgorp/research/#cavit).

Conclusion: in a UML context, you may not need such a singleton type
with a stereotype but indeed your approach still works fine.  Good to
learn that it was already applied in 1993 :-)

Kind regards,
-- 
Pieter Van Gorp
       Teaching and Research Assistant
       Department of Mathematics and Computer Science
       University of Antwerp
       Middelheimlaan 1
       2020 Antwerpen - Belgium
       Office: G.304
       Phone: +32 3 265 38 71
       Fax: +32 3 265 37 77
       http://www.fots.ua.ac.be/~pvgorp/research/
       http://motmot.sourceforge.net/

PS: let me quote Oscar Wilde to put the criticism on the UML in a
humoristic perspective: No object is so beautiful that, under certain
conditions, it will not look ugly.
Received on Wed 17 May 2006 - 09:35:41 BST