comp.lang.ada
 help / color / mirror / Atom feed
From: Matteo Bordin <matteo.bordin@gmail.com>
Subject: Re: Ada and UML
Date: Tue, 31 Aug 2010 09:34:11 -0700 (PDT)
Date: 2010-08-31T09:34:11-07:00	[thread overview]
Message-ID: <e6746ed7-5984-431c-be85-bdc999fe0d0a@h19g2000yqb.googlegroups.com> (raw)
In-Reply-To: op.viawo1r3ule2fv@garhos

On Aug 31, 1:54 pm, Yannick Duchêne (Hibou57)
<yannick_duch...@yahoo.fr> wrote:
> Le Tue, 31 Aug 2010 13:05:43 +0200, Yannick Duchêne (Hibou57)  
> <yannick_duch...@yahoo.fr> a écrit:> Also, the Extend relationship, could be used to express the Ada's child  
> > package relationship. But I am not sure this is valid UML to use the  
> > extend relation between two UML packages.
>
> > And what about the Composition relationship to express Ada's nested  
> > package relationship ?
>
> To be more exact, UML Name Space should be used instead of UML Package, as  
> Ada's package are both package and name-space at a time. Just have to hope  
> that Name Space is interpreted as a special case of Package for everyones,  
> otherwise Welcome Troubles.

Hello Yannick,

UML semantics can be found in the UML metamodel superstructure at
http://www.omg.org/spec/UML/2.3/Superstructure/PDF/. As you said, UML
has no formally specified semantics - but this is also true for most
languages we use everyday (including Ada): I think it is really unfair
to keep bashing UML for not having a "formal semantics" while
basically all languages we use suffers of the same problem. The only
exceptions I am aware of are SPARK and some languages of the
synchronous family (Lustre, Esterel, ...).

Mapping Ada on UML means treating UML as graphical coding: in my
personal opinion this defeats the main purpose of UML - i.e. being a
platform-independent language. Ada profiles for UML surely exists, but
they make UML models implicitly not implementable on any other
programming language. I personally find language-specific UML profiles
a total non-sense. Having said that, it is unfortunate that an
incestuous relationship between UML and Java/C++ exists.

Anyway, one reasonable approach to represent Ada packages in
"standard" UML is to use a non extendible (isLeaf=true) UML singleton
class. Package-level variables, constants and non-primitive operations
can be mapped as static features (isStatic=True) of the singleton
class. Types declared within the Ada package can be represented as
nested non-singleton classes contained in the singleton class above (a
UML nested classifier is equivalent to Java/C++ nested classes). Ada
child packages can be mapped as nested, non-extensible singletons. As
you can see, this representation does not sound very natural from a
UML point-of-view, but covers the Ada semantics.

The extend relationships relates to UML types only: in UML, a Package
is not a type, so it cannot be extended in the UML sense. You also
cannot directly use UML NameSpace because it is an abstract semantic
element (an abstract metaclass).

Cheers,

Matteo



  reply	other threads:[~2010-08-31 16:34 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-31 10:12 Ada and UML Yannick Duchêne (Hibou57)
2010-08-31 11:05 ` Yannick Duchêne (Hibou57)
2010-08-31 11:54   ` Yannick Duchêne (Hibou57)
2010-08-31 16:34     ` Matteo Bordin [this message]
2010-08-31 21:20       ` nobody
2010-09-02  0:19         ` Yannick Duchêne (Hibou57)
2010-09-02  6:14           ` Simon Wright
2010-09-02 20:33           ` nobody
2010-08-31 23:14       ` Yannick Duchêne (Hibou57)
2010-08-31 23:31         ` Yannick Duchêne (Hibou57)
2010-09-01  8:20         ` Matteo Bordin
2010-09-01 18:44           ` Simon Wright
2010-09-01 21:56             ` Simon Wright
2010-09-02  1:18             ` Yannick Duchêne (Hibou57)
2010-09-02 10:25               ` Brian Drummond
2010-09-02  0:43           ` Yannick Duchêne (Hibou57)
2010-09-02  7:50             ` Georg Bauhaus
2010-09-02 23:05               ` Yannick Duchêne (Hibou57)
2010-09-03  4:19                 ` Yannick Duchêne (Hibou57)
2010-09-03  6:54                   ` Matteo Bordin
2010-09-03 10:20                     ` Yannick Duchêne (Hibou57)
2010-09-03 11:33                       ` sjw
2010-09-03 13:18                   ` Hibou57 (Yannick Duchêne)
2010-09-03 16:14                     ` Matteo Bordin
2010-09-04 14:51                       ` Yannick Duchêne (Hibou57)
2010-09-06  9:21                         ` Matteo Bordin
2010-09-07 18:25                         ` Yannick Duchêne (Hibou57)
2010-09-03 16:16                     ` Matteo Bordin
2010-09-03 19:39                       ` Simon Wright
2010-08-31 18:25 ` Martin Krischik
2010-09-01  8:40   ` sjw
2010-09-02  0:22   ` Yannick Duchêne (Hibou57)
2010-09-02  4:48     ` J-P. Rosen
2010-09-02 10:34       ` Brian Drummond
2010-09-02 13:00         ` Robert A Duff
2010-09-02 13:24           ` Yannick Duchêne (Hibou57)
2010-09-10 20:13 ` Yannick Duchêne (Hibou57)
  -- strict thread matches above, loose matches on Subject: below --
2001-08-04  9:55 Paul Foster
2001-07-10 10:54 Death by analogy Part 2 (was Re: is ada dead?) Robert C. Leif, Ph.D.
2001-07-10 16:58 ` Al Christians
2001-07-10 18:39   ` Michael P. Card
2001-07-10 20:39     ` Al Christians
2001-07-10 21:11       ` Michael P. Card
2001-07-11  5:25         ` Ada and UML raj
2001-07-11  9:40           ` David C. Hoos, Sr.
2001-07-13 19:00           ` Nick Williams
2001-07-13 19:46             ` Ted Dennison
2001-07-17  8:25               ` David Humphris
2001-07-16  0:56             ` Ken Garlington
2001-07-17 18:59               ` Simon Wright
2001-07-23 14:38                 ` John Kern
2001-08-04  6:29                   ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox