comp.lang.ada
 help / color / mirror / Atom feed
From: Matteo Bordin <matteo.bordin@gmail.com>
Subject: Re: Ada and UML
Date: Wed, 1 Sep 2010 01:20:30 -0700 (PDT)
Date: 2010-09-01T01:20:30-07:00	[thread overview]
Message-ID: <dd02ebde-76cf-4d79-8214-5059b121bc82@i31g2000yqm.googlegroups.com> (raw)
In-Reply-To: op.vibr57wyule2fv@garhos


>
> > 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.
>
> I did not want to be unfair and I had this “be fair” requirement in mind.
> While I should not have used the “formal” qualifier, you are right (formal
> may means multiple things, just like semantic, safe, etc).
>
> I have read some UML tutorial in the paste, and found it was always
> talking about syntax, and just a few about meaning. But as I am not a
> specialist in this domain, I wanted to be sure and seek for UML semantic
> docs. Among others, I found this one:http://www.imamu.edu.sa/DContent/IT_Topics/UML%20Semantics%20FAQ.pdf
> which confirm there is a lack of semantic. As an example: they state UML
> does not even tell anything about weither or not a message queued to a
> task will be always processed or not. Ada is not formally specified in the
> mathematical sense, but at least it answers such questions well.

One of the goals of UML is to permits UML models to be implemented on
several run-time platforms: for this to be possible, either you create
a language which is the union of all possible computational models, or
you leave semantic variation points to permit model transformation
(code generators) to inject platform-specific semantics following a
precise pattern. UML chose the second option. The core idea is that,
by modeling your execution platform, you can "instruct" your code
generator to generate code with a fully specified semantics for a
precise target platform starting from an abstract model. This permits
to re-use the same model for different target platforms by just
changing code generator and platform model and to perform high-level
verifications without including "pollution" from the underlying run-
time.

> > 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.
>
> I have never talk about UML profile ;) I talked about meaning of
> notational elements and attempted to express them in terms of Ada
> construct meaning. There is no worry about stating UML Name Space better
> match Ada's package than UML Package does. This is not an UML profile.
> Except may be for restriction like “only use the ~ visibility modifier”.
> But this could be as well a required UML subset to match some design
> criteria, just like there are Ada subsets (Ranvenscar, SPARK, and may be
> others).
>
> Also note that an Ada profile and UML profile does not stands for the same
> thing: UML profile means possibly adding notational components to UML via
> prototypes, while Ada profile means strict subset of Ada, don't even think
> about adding anything. These are two opposite!

UML profile can be purely constrictive. For example, a UML profile may
state that you cannot use Interfaces. This is expressed in OCL as
Interface.allInstances()->size() = 0. No need for stereotypes. From
this point of view, a UML Profile provides the same service as an Ada
profile. UML profile can also be used to define modeling standards
(mirroring the notion of coding standard).

> > Anyway, one reasonable approach to represent Ada packages in
> > "standard" UML is to use a non extendible (isLeaf=true) UML singleton
> > class.
>
> An UML class to represent a package ? Can you tell more ? What is the
> difference with the name-space choice ?

The problem is that Ada Packages can have non-primitive operations and
variables, but UML Packages can't. The only place where you can put an
operation in UML is inside some behavioural classifiers (Class,
Interface, DataType, ...). So, if you want to represent Ada packages
with non-primitive operations, the only option is to map the Ada
Package on a UML class. On the other side, if your Ada program is
fully object-oriented (only primitive operations), you can use UML
packages to map Ada packages and UML classes to map Ada tagged/record
types.

In UML a NameSpace is an abstract metaclass (a sort of abstract
grammar rule), which is extended by concrete metaclasses. BTW, UML
Class inherits from NameSpace: in UML a Class is a NameSpace.


> > Package-level variables, constants and non-primitive operations
> > can be mapped as static features (isStatic=True) of the singleton
> > class.
>
> I have played a bit with a textual variant of UML which generates graphs
> via GraphViz ; this is called PlantUML. And actually it does not provide
> the attributes you mentioned.http://plantuml.sourceforge.net/

They are part of the UML standard and can be found in true UML
implementations such as those on the Eclipse platform (http://
www.eclipse.org/modeling/mdt/?project=uml2tools, topcased.org,
papyrusuml.org).


> I was a bit long with this reply, let go for a summary: give UML the
> semantic of the target language (implies this choice is maid à-priori),
> use notation restrictions as much as needed (should be documented, which
> is OK, as UML seems to have provision for so called Preface).

I disagree ;-) This approach means using UML at the same abstraction
level of a traditioanl programming language. A desirable modeling
approach based on languages of the UML family is to separate what is
platform-independent from what is platform-specific to permit the re-
use of platform-independent models. Let's make an example about
tasking. You can have a platform-independent UML model where you
identify "unit of concurrency". And another, platform-specific UML
model where you describe the low-level implementation in terms of
(Ada, C, ARINC-653, ...) tasks. Then you allocate the platform-
independent UML model on the platform-specific one by binding elements
of the first model on elements of the second one. This way you can
reuse the platform-independent model on several different run-time
architectures by simply providing new platform-specific models and new
bindings. You may get more information on this approach by reading
tutorials on MARTE (omgmarte.org).



  parent reply	other threads:[~2010-09-01  8:20 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
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 [this message]
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