comp.lang.ada
 help / color / mirror / Atom feed
* Ada and UML
  2001-07-10 21:11       ` Michael P. Card
@ 2001-07-11  5:25         ` raj
  2001-07-11  9:40           ` David C. Hoos, Sr.
  2001-07-13 19:00           ` Nick Williams
  0 siblings, 2 replies; 47+ messages in thread
From: raj @ 2001-07-11  5:25 UTC (permalink / raw)


Are there any UML tools around that support Ada ?



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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
  1 sibling, 0 replies; 47+ messages in thread
From: David C. Hoos, Sr. @ 2001-07-11  9:40 UTC (permalink / raw)
  To: comp.lang.ada; +Cc: israelrt

Yes.  See UMLStudio at http://www.pragsoft.com

----- Original Message ----- 
From: "raj" <israelrt@optushome.com.au>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: July 11, 2001 12:25 AM
Subject: Ada and UML


> Are there any UML tools around that support Ada ?
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
> 




^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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-16  0:56             ` Ken Garlington
  1 sibling, 2 replies; 47+ messages in thread
From: Nick Williams @ 2001-07-13 19:00 UTC (permalink / raw)


raj wrote:

> Are there any UML tools around that support Ada ?


Rational Rose?

Cheers,

Nick.






^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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
  1 sibling, 1 reply; 47+ messages in thread
From: Ted Dennison @ 2001-07-13 19:46 UTC (permalink / raw)


In article <3B4F454D.7090200@acm.org>, Nick Williams says...
>
>raj wrote:
>
>> Are there any UML tools around that support Ada ?
>
>
>Rational Rose?

Telelogic TAU does too (I believe that's its name today).

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2001-07-13 19:00           ` Nick Williams
  2001-07-13 19:46             ` Ted Dennison
@ 2001-07-16  0:56             ` Ken Garlington
  2001-07-17 18:59               ` Simon Wright
  1 sibling, 1 reply; 47+ messages in thread
From: Ken Garlington @ 2001-07-16  0:56 UTC (permalink / raw)


"Nick Williams" <nickw@acm.org> wrote in message
news:3B4F454D.7090200@acm.org...
: raj wrote:
:
: > Are there any UML tools around that support Ada ?
:
:
: Rational Rose?

I've heard rumors that Rose is quietly dropping Ada support?





^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2001-07-13 19:46             ` Ted Dennison
@ 2001-07-17  8:25               ` David Humphris
  0 siblings, 0 replies; 47+ messages in thread
From: David Humphris @ 2001-07-17  8:25 UTC (permalink / raw)


Ted Dennison wrote
> >raj wrote:
> >
> >> Are there any UML tools around that support Ada ?
> >
> >
> >Rational Rose?
>
> Telelogic TAU does too (I believe that's its name today).

Aonix Software through Pictures (StP) is another to support Ada.

David Humphris
Aonix





^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2001-07-16  0:56             ` Ken Garlington
@ 2001-07-17 18:59               ` Simon Wright
  2001-07-23 14:38                 ` John Kern
  0 siblings, 1 reply; 47+ messages in thread
From: Simon Wright @ 2001-07-17 18:59 UTC (permalink / raw)


"Ken Garlington" <Ken.Garlington@computer.org> writes:

> "Nick Williams" <nickw@acm.org> wrote in message
> news:3B4F454D.7090200@acm.org...
> : raj wrote:
> :
> : > Are there any UML tools around that support Ada ?
> :
> :
> : Rational Rose?
> 
> I've heard rumors that Rose is quietly dropping Ada support?

Depends what you mean by _support_, but I've been working on an
open-source code generator, currently front-ended by Rose (basic
edition). http://www.pushface.org/coldframe/




^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2001-07-17 18:59               ` Simon Wright
@ 2001-07-23 14:38                 ` John Kern
  2001-08-04  6:29                   ` Simon Wright
  0 siblings, 1 reply; 47+ messages in thread
From: John Kern @ 2001-07-23 14:38 UTC (permalink / raw)


I wonder if you could briefly describe what advantages your program has
over the Ada95 code generation already offered by Rational?

Thanks

Simon Wright wrote:
> 
> "Ken Garlington" <Ken.Garlington@computer.org> writes:
> 
> > "Nick Williams" <nickw@acm.org> wrote in message
> > news:3B4F454D.7090200@acm.org...
> > : raj wrote:
> > :
> > : > Are there any UML tools around that support Ada ?
> > :
> > :
> > : Rational Rose?
> >
> > I've heard rumors that Rose is quietly dropping Ada support?
> 
> Depends what you mean by _support_, but I've been working on an
> open-source code generator, currently front-ended by Rose (basic
> edition). http://www.pushface.org/coldframe/



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2001-07-23 14:38                 ` John Kern
@ 2001-08-04  6:29                   ` Simon Wright
  0 siblings, 0 replies; 47+ messages in thread
From: Simon Wright @ 2001-08-04  6:29 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3021 bytes --]

John Kern <jkern3@NOSPAM.visteon.com> writes:

> Simon Wright wrote:

> > Depends what you mean by _support_, but I've been working on an
> > open-source code generator, currently front-ended by Rose (basic
> > edition). http://www.pushface.org/coldframe/

> I wonder if you could briefly describe what advantages your program
> has over the Ada95 code generation already offered by Rational?

[Sorry for delay in reply, I've been on holiday]

Well, it's open source :-) However, to quote from
http://www.pushface.org/coldframe/architecture.html,

  It's fundamental to the idea of ColdFrame that you don't need to
  build a design model by decorating your clean, beautiful analysis
  model with all sorts of support clutter (lists, queues etc). The
  software architect decides how analysis models are to be translated
  into code, and a mechanical process (applied either by a programmer
  or by a program) applies the rules.

  Examples of commercial products which take this approach are
  Software through Pictures from Aonix and ARTiSAN Software's
  Real-Time Modeler[1].

  It's important that the tool lets the architect adopt different
  strategies depending on circumstances. For example, ColdFrame
  generates quite different code for a class with the stereotype
  �singleton�.

  This need makes it very advantageous to have a complete programming
  environment available while scripting the output. Predetermined
  substitution variables aren't likely to fill the bill.

and from http://www.pushface.org/coldframe/use-cases.html#SEC1

  When code is automatically generated from a model (in the present
  case, a UML model), there are two approaches:

  Use a Design Model 

       A design model is derived from an analysis model by adding
       support classes to map the analysis model to the Software
       Architecture (see section Software Architecture). An example
       would be a container for all the instances of a given class. A
       tool which uses this approach is Rational Rose.

  Use an Analysis model

       An analysis model contains classes and relationships that are
       part of the subject matter of the analyzed subsystem. Code
       which supports the execution of the model (for example,
       navigation from an instance of one class through an association
       to find the set of corresponding instances of another class) is
       automatically generated. Tools which use this approach include
       Software through Pictures from Aonix, Rhapsody from I-Logix,
       iUML from Kennedy-Carter, BridgePoint from Project Technology,
       and the present project.

The Rose alternative to programmability is that extraordinarily
complicated Code Generation Properties dialog box, which gives each of
your developers complete freedom to generate code in different ways
(but only within the limits of variability allowed by the vendor
(bad)).


[1] Actually I'm not so sure about the ARTiSAN product, which I
understand is now available for Ada but haven't seen.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Ada and UML
@ 2001-08-04  9:55 Paul Foster
  0 siblings, 0 replies; 47+ messages in thread
From: Paul Foster @ 2001-08-04  9:55 UTC (permalink / raw)


This posting is an extension to my previous posting :
Which OO is in ?? - 02/08/2000

I'd like some addition feedback regarding the use of UML on Ada
projects. For those that have used UML or are currently using UML
what have been the main problems? Which features of UML were
difficult if not impossible to implement and what UML subsets if
any were used to overcome these problems. I'm interested in feedback
for Ada83/95, full-blown and subsets (i.e. SPARK etc).

I'd like to know also what CASE tools are being used or are highly
rated.

Thanks to all respondents





^ permalink raw reply	[flat|nested] 47+ messages in thread

* Ada and UML
@ 2010-08-31 10:12 Yannick Duchêne (Hibou57)
  2010-08-31 11:05 ` Yannick Duchêne (Hibou57)
                   ` (2 more replies)
  0 siblings, 3 replies; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-08-31 10:12 UTC (permalink / raw)


Hi all,

A few days ago I get to have a look back at UML after a topic linking to  
an assessment stating graphical representations may help in  
design/application validation. Someone argued there is a lack of semantic  
with UML which dismiss its usage ; one topic I agree on, and after some  
reading to be sure, it seems indeed, there does not have a clearly defined  
semantic (*)

Another topic I oftenly read/heard about Ada and UML, is that it is too  
much oriented toward Java/C++, lacking as an example, handling of class  
and package orthogonality which is typical of Ada.

I've just discovered today it seems there is a kind of package visibility  
with UML expression of classes, which could match Ada concept of package:  
the visibility modifier “~” (the Tilde sign) which seems to means “Private  
at package level”. This should be sufficient for Ada. Nevertheless, there  
is nothing like “friend” or “protected” in Ada, as visibility is only  
handled by packages, so this visibility modifiers could just be  
disallowed. Do you think “~” is OK to express visibility handled by  
packages ?

For you who tried Ada and UML, did you noticed some others unsolvable  
matters to express Ada package in UML ?


(*) TBH, some peoples with interests in UML was aware of that, started  
some research on 1997 to draw a formal definition of the UML semantic, but  
any research in that area seemed to end on 2004, without any successful  
completion.

P.S. As the purpose of UML is clearly underspecification, may be the  
question of this thread does not really matters, as Ada is acting at  
implementation level.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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 18:25 ` Martin Krischik
  2010-09-10 20:13 ` Yannick Duchêne (Hibou57)
  2 siblings, 1 reply; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-08-31 11:05 UTC (permalink / raw)


Le Tue, 31 Aug 2010 12:12:43 +0200, Yannick Duchêne (Hibou57)  
<yannick_duchene@yahoo.fr> a écrit:
> I've just discovered today it seems there is a kind of package  
> visibility with UML expression of classes, which could match Ada concept  
> of package: the visibility modifier “~” (the Tilde sign) which seems to  
> means “Private at package level”.
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 ?

-- 
“Dual licensing is the Perl's way to disinfect the GNU General Public  
Virus!” (anonymous)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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
  0 siblings, 1 reply; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-08-31 11:54 UTC (permalink / raw)


Le Tue, 31 Aug 2010 13:05:43 +0200, Yannick Duchêne (Hibou57)  
<yannick_duchene@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.


-- 
“Dual licensing is the Perl's way to disinfect the GNU General Public  
Virus!” (anonymous)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-08-31 11:54   ` Yannick Duchêne (Hibou57)
@ 2010-08-31 16:34     ` Matteo Bordin
  2010-08-31 21:20       ` nobody
  2010-08-31 23:14       ` Yannick Duchêne (Hibou57)
  0 siblings, 2 replies; 47+ messages in thread
From: Matteo Bordin @ 2010-08-31 16:34 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-08-31 10:12 Ada and UML Yannick Duchêne (Hibou57)
  2010-08-31 11:05 ` Yannick Duchêne (Hibou57)
@ 2010-08-31 18:25 ` Martin Krischik
  2010-09-01  8:40   ` sjw
  2010-09-02  0:22   ` Yannick Duchêne (Hibou57)
  2010-09-10 20:13 ` Yannick Duchêne (Hibou57)
  2 siblings, 2 replies; 47+ messages in thread
From: Martin Krischik @ 2010-08-31 18:25 UTC (permalink / raw)


Am 31.08.2010, 12:12 Uhr, schrieb Yannick Duchêne (Hibou57)  
<yannick_duchene@yahoo.fr>:


> For you who tried Ada and UML, did you noticed some others unsolvable  
> matters to express Ada package in UML ?

Actually I always thought that Ada and UML fit better then most other  
languages and  UML- especially packages as most languages don't have  
packages. Not surprising as Rational Rose was written in Ada and Garry  
Booch used Ada in his early days. I think (but can't prove) that UML got  
it package concept from Ada in the first place.

Martin

-- 
Martin Krischik
mailto://krischik@users.sourceforge.net
https://sourceforge.net/users/krischik



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-08-31 16:34     ` Matteo Bordin
@ 2010-08-31 21:20       ` nobody
  2010-09-02  0:19         ` Yannick Duchêne (Hibou57)
  2010-08-31 23:14       ` Yannick Duchêne (Hibou57)
  1 sibling, 1 reply; 47+ messages in thread
From: nobody @ 2010-08-31 21:20 UTC (permalink / raw)




Matteo Bordin wrote:
> Ada profiles for UML surely exists, but
> they make UML models implicitly not implementable on any other
> programming language. 

There are also platform independent profiles with semantics. I use one 
every day called xtUML. And translate the same models to both C++ and 
Ada-95. Spark is under development.

The xtUML profile is used for ANALYSIS models. We do NOT code C++ or Ada 
in UML. We do analysis. Then the translation into code is just something 
mechanical.




^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-08-31 16:34     ` Matteo Bordin
  2010-08-31 21:20       ` 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
  1 sibling, 2 replies; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-08-31 23:14 UTC (permalink / raw)


Le Tue, 31 Aug 2010 18:34:11 +0200, Matteo Bordin  
<matteo.bordin@gmail.com> a écrit:
> Hello Yannick,
Hi Matteo :)


> 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.

TBH, see also a later comment below about UML and semantic.

> The only
> exceptions I am aware of are SPARK and some languages of the
> synchronous family (Lustre, Esterel, ...).
Thanks for other references ;) Will be worth reading I feel.

> Mapping Ada on UML means treating UML as graphical coding: in my
> personal opinion this defeats the main purpose of UML.
Fully agree. I said “the purpose of UML is clearly underspecification”.

> Ada profiles for UML surely exists, but
> they make UML models implicitly not implementable on any other
> programming language.
Good point.

> 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!

I was talking about UML subset. This should match both expectations, yours  
and mine. Subset may enforce clearer meaning (as an example, avoiding to  
have multiple notation to express the same thing), while not extended the  
notation, so that it is not tied to a particular language (I love your  
comment about it). I agree with the criteria (UML should not be tied to  
any design language).

> 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 ?

> 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/

> 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.
So all can be done with class and no need anymore for UML package ? Class  
can be static, leaf and so on. OK. I did not read UML Superstructure,  
because it is a very long document, and that is not handy to read such  
long document on a computer screen. I wish I will do later (I just get a  
quick overview so far).

> 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.
So the schemas I "draw" was wrong. I used the Extends relation on package.

> You also
> cannot directly use UML NameSpace because it is an abstract semantic
> element (an abstract metaclass).
>
> Cheers,
>
> Matteo
OK.

Above I said will lave a comment about UML and semantic. Here is: as UML  
is notation and notation + method, its semantic was likely to be less  
precise. I had a look at Merise too, because I do not trust arguments like  
“every body wants UML, no one ask for Merise which is dead” (I do not know  
about HOOD, so I have no way to talk bout it, due to lack of online  
documents). I did not care and and try to get an overview, and feel UML  
notation was more rich and Merise's method makes me think about the V  
cycle which is famous for its flaws. I though UML = richer notations, so  
better coverage, may be better suited for repetitive reification, which  
seems common, especially for people working alone (better suited in this  
context). Then about lack of semantic, I though: if used as an  
architecture and design outliner, implicit reference to a predefined  
implementation language may not be so bad after all. Wiether one use Ada  
or C, and provided this choice is done for good reason, and the choice is  
made a the very beginning, the one could always refer to task as an  
example, the way the target language handles this. After all, when one say  
“the app will need three concurrent task”, this one will then just say  
“Ada tasking model is like this, C way to handle task is like this”.  
Talking about task this way, is design talking, not implementation  
talking. If UML is design and architecture talking, may be its fuzzy  
semantic is not so much likely to cause trouble.

Note: the semantic matter arise a detailed level, less at the big picture  
level. This is important to note.

Although contradictory to the above, if ever a mathematically defined  
semantic of UML was ever there, this would still be welcome. But then,  
this would implies the process would not be the same as the one suggested  
above.

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).


-- 
“Dual licensing is the Perl's way to disinfect the GNU General Public  
Virus!” (anonymous)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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
  1 sibling, 0 replies; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-08-31 23:31 UTC (permalink / raw)


Le Wed, 01 Sep 2010 01:14:21 +0200, Yannick Duchêne (Hibou57)  
<yannick_duchene@yahoo.fr> a écrit:
> Above I said will lave a comment about UML and semantic. Here is: as UML  
> is notation and notation + method,

Forget a word, please read instead

    Above I said will laave a comment about UML and semantic. Here is: as  
UML
    is notation and Mereise is notation + method,



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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-02  0:43           ` Yannick Duchêne (Hibou57)
  1 sibling, 2 replies; 47+ messages in thread
From: Matteo Bordin @ 2010-09-01  8:20 UTC (permalink / raw)



>
> > 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).



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-08-31 18:25 ` Martin Krischik
@ 2010-09-01  8:40   ` sjw
  2010-09-02  0:22   ` Yannick Duchêne (Hibou57)
  1 sibling, 0 replies; 47+ messages in thread
From: sjw @ 2010-09-01  8:40 UTC (permalink / raw)


On Aug 31, 7:25 pm, "Martin Krischik" <krisc...@users.sourceforge.net>
wrote:
 
>          Not surprising as Rational Rose was written in Ada and Garry  
> Booch used Ada in his early days.

Grady



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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  0:43           ` Yannick Duchêne (Hibou57)
  1 sibling, 2 replies; 47+ messages in thread
From: Simon Wright @ 2010-09-01 18:44 UTC (permalink / raw)


Matteo Bordin <matteo.bordin@gmail.com> writes:

> 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 was going to draft a reply but Matteo has said almost all that I would
have done. I'd add that

1 I wouldn't expect every possible UML construct to be translatable
  using this model. A given vendor/toolset might well specify
  limitations, presumably as a profile.

2 I wouldn't expect to be able to tweak the UML so as to generate any
  arbitrary target language (Ada) construct.

3 The converse of 3: I wouldn't expect to be able to represent any
  arbitrary target language (Ada) program in UML so as to be able to
  regenerate it.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-01 18:44           ` Simon Wright
@ 2010-09-01 21:56             ` Simon Wright
  2010-09-02  1:18             ` Yannick Duchêne (Hibou57)
  1 sibling, 0 replies; 47+ messages in thread
From: Simon Wright @ 2010-09-01 21:56 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> 3 The converse of 3: I wouldn't expect to be able to represent any
>   arbitrary target language (Ada) program in UML so as to be able to
>   regenerate it.

3 The converse of *2*:

grr



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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
  0 siblings, 2 replies; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-09-02  0:19 UTC (permalink / raw)


Le Tue, 31 Aug 2010 23:20:41 +0200, nobody <nobody@nowhere.com> a écrit:
> Then the translation into code is just something mechanical.

I do not really believe in automatic source generation from UML, as there  
may be multiple possibilities. Or else, may be these systems use something  
to tell “for This, use That”. Just think that in Ada, you may have for  
example at least, where polymorphism is required, two ways to do (when  
feasible, sometime only one will applies) : static (via generics) and  
dynamic (via tagged or interface) polymorphism. How can a system know it  
should use this or that ? This requires a human analysis, to say “well,  
this can be statically known, so let's use static polymorphism” or else  
the opposite (just an example).

Your point makes me think about the so called “Executable UML”.  
Unfortunately, I do not know anything about it. I am just pretty sure this  
cannot be automated.

If you wan to tell more... just do :)

-- 
“Dual licensing is the Perl's way to disinfect the GNU General Public  
Virus!” (anonymous)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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
  1 sibling, 1 reply; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-09-02  0:22 UTC (permalink / raw)


Le Tue, 31 Aug 2010 20:25:51 +0200, Martin Krischik  
<krischik@users.sourceforge.net> a écrit:
> Actually I always thought that Ada and UML fit better then most other  
> languages and  UML- especially packages as most languages don't have  
> packages. Not surprising as Rational Rose was written in Ada and Garry  
> Booch used Ada in his early days. I think (but can't prove) that UML got  
> it package concept from Ada in the first place.
>
> Martin
Funny point. it happens I had this question too in mind : “where does this  
UML package comes from, as I have never seen something like this if not  
with Ada”.

Funny to also note UML package does not exactly match Ada package. May be  
the inspiration came in two ways : Ada package and Ada orthogonality and  
they wanted to make package and name-space orthogonal ?

I did not knew Grady Booch used Ada. Did he wrote about it also ?


-- 
“Dual licensing is the Perl's way to disinfect the GNU General Public  
Virus!” (anonymous)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-01  8:20         ` Matteo Bordin
  2010-09-01 18:44           ` Simon Wright
@ 2010-09-02  0:43           ` Yannick Duchêne (Hibou57)
  2010-09-02  7:50             ` Georg Bauhaus
  1 sibling, 1 reply; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-09-02  0:43 UTC (permalink / raw)


Le Wed, 01 Sep 2010 10:20:30 +0200, Matteo Bordin  
<matteo.bordin@gmail.com> a écrit:
> 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,
Unreachable target

> or you leave semantic variation points to permit model transformation
> (code generators) to inject platform-specific semantics following a
> precise pattern.
Look like the question I asked in a prior post : how is the source  
generator driven ?

> 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 have the same view or except in one point : I do expect abstraction, but  
I do not expect automatic generation. Instead of the latter, I expect  
abstract view and outlining, which in turn lead to some other questions to  
solve, different than the one of automatic generation (will not talk about  
it here).

> The problem is that Ada Packages can have non-primitive operations and
> variables, but UML Packages can't.
So indeed, this really to not match Ada package.

As it seems some of my words was not understand (I may indeed be  
ambiguous) : when I say this is not the same as Ada package, I do not say  
I expect UML to be another way to write Ada, ... no, I wanted to  
understand things using concept which are already known.

> 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.
I am not sure I understand this. Will later look for a way to understand  
it.

> 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 have tried this. The first two did not want to lauch, only Papyrus  
could. I will try with it (I already tried it in the past, but this is  
another story I will not talk about).

>> 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.
Right, this have to be more abstract. But some stuff requires an exact  
semantic to be interpreted, and this is kind of concrete thing which you  
will typical find with a concrete language like Ada is.

> 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.
And how do you link these various more detailed model to the one which  
seems to be a master abstract model ?

> You may get more information on this approach by reading
> tutorials on MARTE (omgmarte.org).
I had a overiew. It is said to target Real-Time, which is not my direct  
concern, while seems it can be useful for general purpose. Thanks for this  
link.


-- 
“Dual licensing is the Perl's way to disinfect the GNU General Public  
Virus!” (anonymous)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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
  1 sibling, 1 reply; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-09-02  1:18 UTC (permalink / raw)


Le Wed, 01 Sep 2010 20:44:09 +0200, Simon Wright <simon@pushface.org> a  
écrit:
> I was going to draft a reply but Matteo has said almost all that I would
> have done. I'd add that
>
> 1 I wouldn't expect every possible UML construct to be translatable
>   using this model. A given vendor/toolset might well specify
>   limitations, presumably as a profile.
>
> 2 I wouldn't expect to be able to tweak the UML so as to generate any
>   arbitrary target language (Ada) construct.
I did not expected this, nor me.

> 3 The converse of 2: I wouldn't expect to be able to represent any
>   arbitrary target language (Ada) program in UML so as to be able to
>   regenerate it.

What I expect, may be explained with concrete cases.

I feel for long source does not came with all value and sometime, the  
“clever idea” in something comes at an abstract level which not any more  
clearly visible in a source, even if the source implements this “clever  
idea”. Because the “clever idea” is made implicit and not expressed by the  
source whose target is to express concrete implementation. That is why  
even a well designed application source can be “unreadable”.

As an example, I have an FTP application written 5 years ago. Not so much  
big, 2_000 lines. But I have to rework it, and although there are comments  
and the design was clear at the time I wrote it, it seems impossible to be  
sure to clearly understand what I had in mind at the time. I have another  
web application, 70_000 lines, which is clear to me for the time, as I  
oftenly come back to it... but will this always be like this ? I am afraid  
if I ever switch to something else for a long time or want a later date to  
collaborate with any somebody, things gonna be wrong.

Structuration, god entity naming, etc, are nice things, but this is simply  
not enough.

And what if I ever want to re-implement these things in another language ?  
(one is C, the other is Pascal and JS) A direct translation to Ada (which  
I plan for the future) would surely turn into many errors every where.

I also had some other similar though about UI design.

This is these topics I have in mind. I am not seeking for another way to  
write Ada with something else than Ada.

May be we agree in some points and I did express it the good way.

As some ones says : you do not see the face on a printed image looking at  
the little colored dots the raster printer drawn on the paper. And this is  
sadly true even with tiny pictures (it is frightening to think something  
as simple a 2_000 lines application can become so much unclear... and what  
about bigger things...).

But while I feel this may help, I still have some doubt about the UML  
approach : what about things which are not design or architecture and  
which are rather algorithmic ? Is UML well suited to express algorithm in  
an abstract manner ? In that area, I had a recent look at (S)ML, but still  
do not have a clear though (there are state machines in UML, I known, but  
this is not enough, and an algorithm too may have multiple  
implementations, so a more abstract view than a particular implementation  
could be welcome too).

Still in this area, I also explored and tested other techniques, but I'm  
afraid I would become boring... (at least I have a better picture of the  
subject than the one I had, say, 3 years ago)

Have a nice day all



-- 
“Dual licensing is the Perl's way to disinfect the GNU General Public  
Virus!” (anonymous)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-02  0:22   ` Yannick Duchêne (Hibou57)
@ 2010-09-02  4:48     ` J-P. Rosen
  2010-09-02 10:34       ` Brian Drummond
  0 siblings, 1 reply; 47+ messages in thread
From: J-P. Rosen @ 2010-09-02  4:48 UTC (permalink / raw)


Le 02/09/2010 02:22, Yannick Duchêne (Hibou57) a écrit :
> I did not knew Grady Booch used Ada. Did he wrote about it also ?
> 
Oh yes! Here is the sad story of Gradykin Boochwalker.

Grady  Booch was part of the initial Rational team. The company started
by writing the ROLM/Data General (3rd validated compiler), then they
designed their own Ada compiler, and the R1000, a machine whose hardware
was specially tailored for Ada development.

At that time, Booch wrote "Software Engineering with Ada" (translated in
French by J-P. Rosen ;-) ), a book that laid the basis of (composition)
OOD. He then wrote "Software Components with Ada", a book that discussed
all usual data structures. The code is still available off the net as
"the Booch components".

Then, Rational gave up on the idea of a dedicated development machine.
They saw that the market was going C++, and Booch turned to the dark
side of the source...



-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-02  0:19         ` Yannick Duchêne (Hibou57)
@ 2010-09-02  6:14           ` Simon Wright
  2010-09-02 20:33           ` nobody
  1 sibling, 0 replies; 47+ messages in thread
From: Simon Wright @ 2010-09-02  6:14 UTC (permalink / raw)


"Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr> writes:

> Le Tue, 31 Aug 2010 23:20:41 +0200, nobody <nobody@nowhere.com> a écrit:
>> Then the translation into code is just something mechanical.
>
> I do not really believe in automatic source generation from UML, as
> there may be multiple possibilities. Or else, may be these systems use
> something  to tell “for This, use That”. Just think that in Ada, you
> may have for  example at least, where polymorphism is required, two
> ways to do (when  feasible, sometime only one will applies) : static
> (via generics) and  dynamic (via tagged or interface)
> polymorphism. How can a system know it  should use this or that ? This
> requires a human analysis, to say “well,  this can be statically
> known, so let's use static polymorphism” or else  the opposite (just
> an example).

I am (was!) reasonably familiar with the ideas behind one approach to
this, the one originating with Shlaer-Mellor OOA.

You develop a model of your problem. This model is is precise enough
that it can be translated, given a set of rules, into executable code,
but it contains nothing about any specific platform (Ada, C, Java, ... /
embedded, distributed, ...). Note, for UML specifically, this means you
need precise semantics at the model level for this to be possible.

You develop (or buy, or re-use) a translation engine which translates
from that model to the platform you're using today.

> Your point makes me think about the so called “Executable
> UML”. Unfortunately, I do not know anything about it. I am just pretty
> sure this  cannot be automated.

Bridgepoint presently from Mentor Graphics,
http://www.mentor.com/products/sm/model_development/

iUML from Kennedy-Carter, http://www.kc.com/ (see 'Products')

In both cases the actions (the part that does things) are written in a
tool-specific programming language, and one of the jobs of the
translation engine is to turn this into compilable code.

Of particular interest to you, maybe, see
http://www.kc.com/PRODUCTS/iccg/adacode.php where you are offered two
Ada code generators, one for Ada 83 and one for SPARK (I don't know how
the SPARK generator gets 'interesting' pre/post/invariant conditions in
there; obviously the analyst is going to have to provide them).



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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)
  0 siblings, 1 reply; 47+ messages in thread
From: Georg Bauhaus @ 2010-09-02  7:50 UTC (permalink / raw)


On 9/2/10 2:43 AM, Yannick Duchêne (Hibou57) wrote:
> Le Wed, 01 Sep 2010 10:20:30 +0200, Matteo Bordin <matteo.bordin@gmail.com> a écrit:

>> or you leave semantic variation points to permit model transformation
>> (code generators) to inject platform-specific semantics following a
>> precise pattern.
> Look like the question I asked in a prior post : how is the source generator driven ?

It depends on the tools.  Start from this question: What drives
your own design decisions when writing this or that source code?

In order to have a name, let's call this source of design
decisions a Shape_O_Mind.

How can you picture the decisions of Shape_O_Mind?

How does Shape_O_Mind operate?

What "tools" does Shape_O_Mind use in order to produce source
text?


Some UML tools come with source templates. UML constructs will
be mapped  to source with the help of these templates.

Some UML tools include a programming language with which to
generate source from the models.

Some UML tools tie source to models, allowing round trip
engineering. They read source, too, and assign model elements
to source code. Not sure if the programmer can always control
this assignment of meaning during this reverse engineering done
by the tool.

Some tools allow the addition of model elements, such as
elements representing subprograms.

The capabilities are not mutually exclusive.

Likely all of these tools permit writing source code
"into" the model entities; the generators will insert this source.
They will not touch it during reverse engineering.

Some UML tools may push integration further to be seamless: you use
one IDE and then a UML model is just another view of your program's
source text.


Other benefits of UML tools that, I think, are not
readily available with just Ada source text:

- model checking

- "specifictation tracking"

When tackling complex relations in some program,
Shape_O_Mind has to rely on our limited capacity for
following indirections, conditionals, etc.

The relation between the set of compilation units
corresponding to problem domain entities isn't an
immediate one either.


Some higher level model elements will *not* depend on the
programming language, or on the computer used to execute
the program. How do you express this in source?

Pictures can help ("worth a thousand words"...).
Assume three Ada packages Pj, each featuring a type Tj,
such that an object of type Tj needs to know about an object
of type T(j+1).

+----+      +----+      +----+
| T1 | <>-> | T2 | <>-> | T3 |
+ ---+      +--- +      +----+

Shape_O_Mind will have little difficulty understanding the  basic
relation or objects, once <> is know to mean aggregation;
a programmer reading source will have to analyze each Pj to find out.


Technical drawings are popular among engineers.
They seem to work.  Why, then, should they not be used
for software systems, too?

Software Through Pictures(TM) is a telling name...



Georg



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-02  1:18             ` Yannick Duchêne (Hibou57)
@ 2010-09-02 10:25               ` Brian Drummond
  0 siblings, 0 replies; 47+ messages in thread
From: Brian Drummond @ 2010-09-02 10:25 UTC (permalink / raw)


On Thu, 02 Sep 2010 03:18:11 +0200, Yannick Duch�ne (Hibou57)
<yannick_duchene@yahoo.fr> wrote:

>Le Wed, 01 Sep 2010 20:44:09 +0200, Simon Wright <simon@pushface.org> a  
>�crit:

>What I expect, may be explained with concrete cases.
>
>I feel for long source does not came with all value and sometime, the  
>�clever idea� in something comes at an abstract level which not any more  
>clearly visible in a source, even if the source implements this �clever  
>idea�.
...
>As an example, I have an FTP application written 5 years ago. Not so much  
>big, 2_000 lines. But I have to rework it, and although there are comments  
>and the design was clear at the time I wrote it, it seems impossible to be  
>sure to clearly understand what I had in mind at the time.
...
>And what if I ever want to re-implement these things in another language ?  
>(one is C, the other is Pascal and JS) A direct translation to Ada (which  
>I plan for the future) would surely turn into many errors every where.

One question possibly worth asking - is UML the right starting point for this
discussion?

It is certainly a candidate - but if the question is, how to capture the essence
of a design independent of the implementation (either before design, or
retrospectively to aid later understanding and possibly re-implementation) - is
it the only, or even the best candidate?

Others might be formal methods - Z or B, discussed here recently. It seems to me
they can be used to capture a specification and ruthlessly test it - but maybe
they cannot be easily applied in retrospect.
 
Or even Bon (which was mentioned here about a year ago). I had never heard of
it, so hunted down the recommended book via Amazon - second hand, ex-library.
It was pristine - it had never been borrowed...

I am probably the wrong persion to ask this question, having no practical
experience of any of these tools (beyond downloading and playing with a UML tool
set), but your post sounds so much like my internal debate that I am interested
in your thoughts.

UML appears to have more momentum and support than all the other options put
together - does that alone make it the right choice?

Or does it offer the best solution on its own merits?

Or does its (relative) popularity mean that a "better" candidate (B, perhaps) is
being overlooked?

- Brian



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-02  4:48     ` J-P. Rosen
@ 2010-09-02 10:34       ` Brian Drummond
  2010-09-02 13:00         ` Robert A Duff
  0 siblings, 1 reply; 47+ messages in thread
From: Brian Drummond @ 2010-09-02 10:34 UTC (permalink / raw)


On Thu, 02 Sep 2010 06:48:18 +0200, "J-P. Rosen" <rosen@adalog.fr> wrote:

>Le 02/09/2010 02:22, Yannick Duch�ne (Hibou57) a �crit :
>> I did not knew Grady Booch used Ada. Did he wrote about it also ?
>> 
>Oh yes! Here is the sad story of Gradykin Boochwalker.
>
>Grady  Booch was part of the initial Rational team. The company started
>by writing the ROLM/Data General (3rd validated compiler), then they
>designed their own Ada compiler, and the R1000, a machine whose hardware
>was specially tailored for Ada development.

Oooh, interesting ... "The horizontally-microprogrammed R1000 provided two
independent 64-bit data paths, permitting simultaneous computation and type
checking".

Sounds a little bit familiar, given other recent threads.

I didn't know about that one. Thanks!

>At that time, Booch wrote "Software Engineering with Ada" (translated in
>French by J-P. Rosen ;-) ), a book that laid the basis of (composition)
>OOD.

Still, IMO, an excellent book; I would love an update to Ada 95/2005...
(admittedly I haven't read the translation!)

>Then, Rational gave up on the idea of a dedicated development machine.
>They saw that the market was going C++, and Booch turned to the dark
>side of the source...

... probably to "close the semantic gap" with the then-fashionable RISC
machines.

- Brian



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-02 10:34       ` Brian Drummond
@ 2010-09-02 13:00         ` Robert A Duff
  2010-09-02 13:24           ` Yannick Duchêne (Hibou57)
  0 siblings, 1 reply; 47+ messages in thread
From: Robert A Duff @ 2010-09-02 13:00 UTC (permalink / raw)


Brian Drummond <brian_drummond@btconnect.com> writes:

> Oooh, interesting ... "The horizontally-microprogrammed R1000 provided two
> independent 64-bit data paths, permitting simultaneous computation and type
> checking".

All attempts to put fancy high-level-language features in hardware
(or microcode -- same thing, from our (software) point of view)
are doomed to failure.  Another example is the Symbolics Lisp
Machine.

- Bob



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-02 13:00         ` Robert A Duff
@ 2010-09-02 13:24           ` Yannick Duchêne (Hibou57)
  0 siblings, 0 replies; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-09-02 13:24 UTC (permalink / raw)


Le Thu, 02 Sep 2010 15:00:07 +0200, Robert A Duff  
<bobduff@shell01.theworld.com> a écrit:
> All attempts to put fancy high-level-language features in hardware
> (or microcode -- same thing, from our (software) point of view)
> are doomed to failure.  Another example is the Symbolics Lisp
> Machine.
The other dark-side of premature optimization :P



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-02  0:19         ` Yannick Duchêne (Hibou57)
  2010-09-02  6:14           ` Simon Wright
@ 2010-09-02 20:33           ` nobody
  1 sibling, 0 replies; 47+ messages in thread
From: nobody @ 2010-09-02 20:33 UTC (permalink / raw)




Yannick Duchêne (Hibou57) wrote:
> Le Tue, 31 Aug 2010 23:20:41 +0200, nobody <nobody@nowhere.com> a écrit:
> 
> I do not really believe in automatic source generation from UML
Neither do I because
- UML is too large, writing a model translator to cover it would take 
longer than writing the system you want to generate.
- UML makes it possible to create models with internal conflicts.

> Or else, may be these systems use 
> something  to tell “for This, use That”. 

As Simon Wright commented. The thing we use is Executeable UML (xtUML). 
I use bridgepoint. For C++ generation we use a model compiler from 
Mentor for Ada we have built one from scratch.

Regarding the for this use that, use it happens. Often. But not always. 
The model compiler is in many cases quite as capable as I to analyze the 
model and decide if instances of one class should be allocated 
dynamically or created once and for all in an array. If traditional 
pointers or some other mechanism should be used for relations and so on.

> Just think that in Ada, you may 
> have for  example at least, where polymorphism is required, two ways to 
> do (when  feasible, sometime only one will applies) : static (via 
> generics) and  dynamic (via tagged or interface) polymorphism. How can a 
> system know it  should use this or that ? This requires a human
> analysis, to say “well,  this can be statically known, so let's use 
> static polymorphism” or else  the opposite (just an example).

There are of cource such examples. But remember that when doing the 
translation from model into code you have the whole model of your system 
available in a databas and can can look at things from a much better 
perspective than when you are coding a single file.

An easy to understand example is relations. If you draw a simple line in 
the class model you state that there is a relation. But the model 
compiler can look at every single line of code in your system to see if 
you use it (navigate) or not. If it sees that you never use it, it wont 
have to generate the code to maintain it and if it finds you only 
navigate one direction it can add the code neded for it to be one way 
only. (Now many hard core coders will feel lost, what does he mean one 
way only, arn't they all? No in xtUML they are always bidirectional, 
composite, aggregate and navigability as in UML does not exist).

> Your point makes me think about the so called “Executable UML”.  
> Unfortunately, I do not know anything about it. I am just pretty sure 
> this  cannot be automated.

I think it can. We are in the process of completing a pretty large 
system. Its got ~650 classes of which probably around 200 has state 
machines. Generated system is > 3000 ada packages.

> If you wan to tell more... just do :)
Sorry, not allowed to give details. Call Mentor, ask for when John Wolfe 
or Cortland Starret can be in your area, you want to have a look at 
their system modelling products.

Simon mentioned distribution. We use that. In our system we can mark 
classes and services as distributed. Then the model compiler generates 
definition files for the broker and in the classes it generates all the 
interface code needed to distribute things when it is updated.

So, do I have anything to complain about? Yes
- Price of the tool.
- Your first project will fail. Try to combine this knowledge with the 
pricecs when you seek finansing.
- Availability of model compilers
- Constantly having to defend the method
- Performance of the model compiler. Coming from a world where a 
recompile takes perhaps as long as 15 seconds entering a world where 
regeneration/recompilation takes three hours is sometimes (read always) 
hard. The generated code is probably faster than anything I could have 
written myself.

Regarding SPARK I know just about nothing. I know there has been work on 
  modifying the Ada compiler to produce spark code. Do not know how far 
that has gone or what efforts need to be done.

There has also been work on generating VHDL. Just think about it. Model 
a system and end up with hardware specific for your problem.

One strange thing the non believers tend to bring up is that software 
development needs to be fun. My comment is that I have now done this for 
six years. It has been the most interesting years of my twenty as a 
professional software developer. The productivity you can reach is 
beyond anything I had imagined before.




^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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)
  0 siblings, 1 reply; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-09-02 23:05 UTC (permalink / raw)


Le Thu, 02 Sep 2010 09:50:12 +0200, Georg Bauhaus  
<rm-host.bauhaus@maps.futureapps.de> a écrit:
> It depends on the tools.  Start from this question: What drives
> your own design decisions when writing this or that source code?

Short reply for the time: this “What drives your own design decisions”  
make me think about something I will have a try with. This is named  
Acceleo, and seems to be used to apply transformation of a model to end up  
into text, which to be sources. But unfortunately, when I want to setup a  
project with this Acceleo, with the hope I could write my own  
transformation, it complains the project must be a Java project. May be  
this means there is no way to use this to generate Ada. As this does not  
come with reverse engineering, I do not see a reason why this could not be  
able to generate any text, thus for any target.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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 13:18                   ` Hibou57 (Yannick Duchêne)
  0 siblings, 2 replies; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-09-03  4:19 UTC (permalink / raw)


Le Fri, 03 Sep 2010 01:05:23 +0200, Yannick Duchêne (Hibou57)  
<yannick_duchene@yahoo.fr> a écrit:
> Short reply for the time: this “What drives your own design decisions”  
> make me think about something I will have a try with. This is named  
> Acceleo, and seems to be used to apply transformation of a model to end  
> up into text, which to be sources. But unfortunately, when I want to  
> setup a project with this Acceleo, with the hope I could write my own  
> transformation, it complains the project must be a Java project. May be  
> this means there is no way to use this to generate Ada.
No, that is solved. You can do Ada with it, and even anything else. Mmmhh,  
important to notice as it works, this implies a full top-down process, not  
sure that's good all the way. And I feel this will not be a peace of cake  
to have a full generator ; so I rather see a kind of template generation.  
Any way, will have a look for a few days to get an idea.

Hint: if anyone is interested in trying this too, get a fresh Eclipse to  
avoid compatibility troubles, then add Acceleo from a bundle, not from the  
Eclipse Modeling Components menu, or else you will get into troubles  
later. Also drop Papyrus if you ever preferred this one, because it will  
not work anymore, and instead, add TopCased from a bundle too. I.e. merge  
Eclipse + Acceleo + TopCased all from their own bundle (weight as much 1G,  
that is very much, but there is no other way).

I did not found any support for Ada in Eclipse, but don't bother, if you  
want to read Ada generated sources, you will just have to switch to GPS,  
as you (maybe) usually do.

For a quick tutorial about Acceleo and Model To Text transformation (this  
is an OMG standard, not a closed standard), you may have a look here :
http://www.acceleo.org/pages/quickstart/en
This example targets HTML, I know, don't worry, the technique will still  
be the same.

That is funny, you do not even have to do refactoring if ever you change  
the name of a class or of anything else: any renaming is automatically  
propagated every where in the modal (was a side note).

-- 
“Dual licensing is the Perl's way to disinfect the GNU General Public  
Virus!” (anonymous)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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 13:18                   ` Hibou57 (Yannick Duchêne)
  1 sibling, 1 reply; 47+ messages in thread
From: Matteo Bordin @ 2010-09-03  6:54 UTC (permalink / raw)


>
> Hint: if anyone is interested in trying this too, get a fresh Eclipse to  
> avoid compatibility troubles, then add Acceleo from a bundle, not from the  
> Eclipse Modeling Components menu, or else you will get into troubles  
> later. Also drop Papyrus if you ever preferred this one, because it will  
> not work anymore, and instead, add TopCased from a bundle too. I.e. merge  
> Eclipse + Acceleo + TopCased all from their own bundle (weight as much 1G,  
> that is very much, but there is no other way).
>
> I did not found any support for Ada in Eclipse, but don't bother, if you  
> want to read Ada generated sources, you will just have to switch to GPS,  
> as you (maybe) usually do.

Papyrus 1.11 includes an UML2-to-Ada2005 code generator. Very
primitive, written just as a counter example for some FUD about Ada
(Ada can't do OO, Java is more expressive than Ada and other
idiocies). BTW, it is written in Acceleo, see
http://www.papyrusuml.org/scripts/home/publigen/content/templates/show.asp?P=131&L=EN&ITEMID=15

You may also want to have a look at GNATbench
http://www.adacore.com/home/products/gnatpro/toolsuite/gnatbench/



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-03  6:54                   ` Matteo Bordin
@ 2010-09-03 10:20                     ` Yannick Duchêne (Hibou57)
  2010-09-03 11:33                       ` sjw
  0 siblings, 1 reply; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-09-03 10:20 UTC (permalink / raw)


Le Fri, 03 Sep 2010 08:54:59 +0200, Matteo Bordin  
<matteo.bordin@gmail.com> a écrit:
> You may also want to have a look at GNATbench
> http://www.adacore.com/home/products/gnatpro/toolsuite/gnatbench/
For others, ... Pro features is surely not for me :P . However for any  
ones, there is a GNAT Bench to build from source, to be used with TopCased  
:
http://gforge.enseeiht.fr/projects/gnatbench/
Appears this is not pure Acceleo, as the project info says “Ada, C, Java”.
Will study this later. For the time I have a silly trouble with Acceleo  
(hope this is not a bug). As soon as it will be solved, I will post here a  
tiny (very tiny) example of UML to Ada transformation using Acceleo  
scripting.

-- 
“Dual licensing is the Perl's way to disinfect the GNU General Public  
Virus!” (anonymous)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-03 10:20                     ` Yannick Duchêne (Hibou57)
@ 2010-09-03 11:33                       ` sjw
  0 siblings, 0 replies; 47+ messages in thread
From: sjw @ 2010-09-03 11:33 UTC (permalink / raw)


On Sep 3, 11:20 am, Yannick Duchêne (Hibou57)
<yannick_duch...@yahoo.fr> wrote:
> Le Fri, 03 Sep 2010 08:54:59 +0200, Matteo Bordin  
> <matteo.bor...@gmail.com> a écrit:> You may also want to have a look at GNATbench
> >http://www.adacore.com/home/products/gnatpro/toolsuite/gnatbench/
>
> For others, ... Pro features is surely not for me :P . However for any  
> ones, there is a GNAT Bench to build from source, to be used with TopCased  
> :http://gforge.enseeiht.fr/projects/gnatbench/

Or you could go to the Libre web site http://libre.adacore.com/ and
find version 2.4.0 (including sources, if wanted)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-03  4:19                 ` Yannick Duchêne (Hibou57)
  2010-09-03  6:54                   ` Matteo Bordin
@ 2010-09-03 13:18                   ` Hibou57 (Yannick Duchêne)
  2010-09-03 16:14                     ` Matteo Bordin
  2010-09-03 16:16                     ` Matteo Bordin
  1 sibling, 2 replies; 47+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2010-09-03 13:18 UTC (permalink / raw)


On 3 sep, 06:19, Yannick Duchêne (Hibou57) <yannick_duch...@yahoo.fr>
wrote:
> No, that is solved. You can do Ada with it

Here is a tiny example, just to show to people with curiosity. This
lack many and many things, this is just to show.

First, the Model to Text transformation. It is able to generate a
package with contained classes implemented as records whose full view
is private. Methods which are not of UML public visibility are
declared in the Ada package private part, the others, in the public
part. Generate the *.ads source only.


   <%metamodel http://www.eclipse.org/uml2/2.0.0/UML%>

   <%script type="uml.NamedElement" name="asTypeName" post="trim()"%>
   <%args(0).name%>_Type

   <%script type="uml.Operation" name="asParameterList"
post="trim()"%>
   Self : <%asTypeName(args(0).parent())%>
   <%if (eAllContents("Parameter")) {%>
      <%for (eAllContents("Parameter")) {%>
         <%if (!name.equalsIgnoreCase("return")) {%>
         ; <%name%> : <%asTypeName(type)%>
         <%}%>
      <%}%>
   <%}%>)

   <%script type="uml.Operation" name="asSignature" post="trim()"%>
   <%if (type == "") {%>
      procedure <%name%> (
      <%asParameterList(current)%>;
   <%}else{%>
      function <%name%> (
      <%asParameterList(current)%>
      return <%asTypeName(type)%>;
   <%}%>

   <%script type="uml.Package" name="Generator_1" file="<%name%>.ads"
%>

   package <%name%> is

      <%for (eAllContents("Class")) {%>
         type <%asTypeName(current)%> is private;

         <%for (eAllContents("Operation")) {%>
            <%if (visibility == "public") {%>
               <%asSignature(current)%>
            <%}%>
         <%}%>
      <%}%>

   private

      <%for (eAllContents("Class")) {%>
         type <%asTypeName(current)%> is record
            <%for (eAllContents("Property")) {%>
               <%name%> : <%asTypeName(type)%>;
            <%}%>
         end record; --  <%asTypeName(current)%>

         <%for (eAllContents("Operation")) {%>
            <%if (visibility != "public") {%>
               <%asSignature(current)%>
            <%}%>
         <%}%>
      <%}%>

   end <%name%>;




Then, a sample UML model it can be applied to (to access XML source of
a model, just access it as a text file):


   <?xml version="1.0" encoding="UTF-8"?>
   <uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/
XMI/2.1" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML"
xmi:id="_qb8akM37EdqwVrslYOdUDA">
     <packagedElement xmi:type="uml:Package"
xmi:id="_w8IxIM37EdqwVrslYOdUDA" name="Greetings">
       <ownedComment xmi:id="_c4EW8LcvEd-uHOxBOe6bQQ"
annotatedElement="_yjuScLcsEd-uHOxBOe6bQQ">
         <body>Your three cents here.</body>
       </ownedComment>
       <packagedElement xmi:type="uml:Class" xmi:id="_yjuScLcsEd-
uHOxBOe6bQQ" name="Greeting_Box" clientDependency="_fD-ewLc4Ed-
uHOxBOe6bQQ">
         <ownedAttribute xmi:id="_gbfysrc1Ed-uHOxBOe6bQQ"
name="Greating_Counter" visibility="package" type="_ImL_4Lc0Ed-
uHOxBOe6bQQ"/>
         <ownedOperation xmi:id="_pudakLcvEd-uHOxBOe6bQQ"
name="Say_Hi"/>
         <ownedOperation xmi:id="_m3Xp8rc1Ed-uHOxBOe6bQQ"
name="Set_Greeting_Counter">
           <ownedParameter xmi:id="_AFKIELc2Ed-uHOxBOe6bQQ"
name="Value" type="_ImL_4Lc0Ed-uHOxBOe6bQQ"/>
         </ownedOperation>
         <ownedOperation xmi:id="_P3XxsLc4Ed-uHOxBOe6bQQ"
name="Get_Greeting_Counter">
           <ownedParameter xmi:id="_lddJULc4Ed-uHOxBOe6bQQ"
name="return" type="_ImL_4Lc0Ed-uHOxBOe6bQQ" direction="return"/>
         </ownedOperation>
         <ownedOperation xmi:id="_NMRYMLdKEd--x_e0zw638A"
name="Have_A_Private_Time" visibility="private"/>
       </packagedElement>
       <packagedElement xmi:type="uml:PrimitiveType"
xmi:id="_ImL_4Lc0Ed-uHOxBOe6bQQ" name="Natural"/>
       <packagedElement xmi:type="uml:Dependency" xmi:id="_fD-ewLc4Ed-
uHOxBOe6bQQ" name="Dependency1" supplier="_ImL_4Lc0Ed-uHOxBOe6bQQ"
client="_yjuScLcsEd-uHOxBOe6bQQ"/>
     </packagedElement>
   </uml:Model>




Sample output. Note that I did not work the generated source
formating ; I know it's ugly.


   package Greetings is

         type Greeting_Box_Type is private;

               procedure Say_Hi (
      Self : Greeting_Box_Type
      );
               procedure Set_Greeting_Counter (
      Self : Greeting_Box_Type
            ; Value : Natural_Type
      );
               function Get_Greeting_Counter (
      Self : Greeting_Box_Type
      )
      return Natural_Type;

   private

         type Greeting_Box_Type is record
               Greating_Counter : Natural_Type;
         end record; --  Greeting_Box_Type

               procedure Have_A_Private_Time (
      Self : Greeting_Box_Type
      );

   end Greetings;


Has a taste of both ASIS (due to semantic access of an UML "source")
and XSLT (due to transform). Never seen like this before.

There may be provision to generate full source when an implementation
is a pure state machine. At least, this is able to generate a more or
less detailed skeleton, but with a better view on the overall types +
tagged + packages architecture/cooperation and probably more.

The limitation I feel: not as much easy and clean to access UML
diagrams semantic this way as it is to access Ada sources semantic
using ASIS. May be this is partly due to the script-like language
which is involved.


Well, any one can now push Ada in UML shops (or perhaps this is UML
pushing in an Ada shop, lol)


How does it work with HOOD ? Does it work the same way ?



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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-03 16:16                     ` Matteo Bordin
  1 sibling, 1 reply; 47+ messages in thread
From: Matteo Bordin @ 2010-09-03 16:14 UTC (permalink / raw)


> On 3 sep, 06:19, Yannick Duchêne (Hibou57) <yannick_duch...@yahoo.fr>
> wrote:
>
> > No, that is solved. You can do Ada with it
>
> Here is a tiny example, just to show to people with curiosity. This
> lack many and many things, this is just to show.

You should use Acceleo 3, which complies with the OMG model-to-text
spec.

I personally think that scripting languages such as Acceleo (or xPand
or similar) are ok just for very simple code generators because they
cannot easily handle persistent datastructures. I cannot imagine
writing a code generator for xUML or for synchronous languages in
Acceleo...

> How does it work with HOOD ? Does it work the same way ?

Supposing you have an Ecore implementation of HOOD, yes, it would work
the same way. May I ask you why you are interested in HOOD? My first
project at university was an HRT-HOOD to Ada Ravenscar code
generator ;-) (http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?
arnumber=1508447).




^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-03 13:18                   ` Hibou57 (Yannick Duchêne)
  2010-09-03 16:14                     ` Matteo Bordin
@ 2010-09-03 16:16                     ` Matteo Bordin
  2010-09-03 19:39                       ` Simon Wright
  1 sibling, 1 reply; 47+ messages in thread
From: Matteo Bordin @ 2010-09-03 16:16 UTC (permalink / raw)


> On 3 sep, 06:19, Yannick Duchêne (Hibou57) <yannick_duch...@yahoo.fr>
> wrote:
>
> > No, that is solved. You can do Ada with it
>
> Here is a tiny example, just to show to people with curiosity. This
> lack many and many things, this is just to show.

You should use Acceleo 3, which complies with the OMG model-to-text
spec.

I personally think that scripting languages such as Acceleo (or xPand
or similar) are ok just for very simple code generators because they
cannot easily handle persistent datastructures. I cannot imagine
writing a code generator for xUML or for synchronous languages in
Acceleo...

> How does it work with HOOD ? Does it work the same way ?

Supposing you have an Ecore implementation of HOOD, yes, it would work
the same way. May I ask you why you are interested in HOOD? My first
project at university was an HRT-HOOD to Ada Ravenscar code
generator ;-) (http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?
arnumber=1508447).




^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-09-03 16:16                     ` Matteo Bordin
@ 2010-09-03 19:39                       ` Simon Wright
  0 siblings, 0 replies; 47+ messages in thread
From: Simon Wright @ 2010-09-03 19:39 UTC (permalink / raw)


Matteo Bordin <matteo.bordin@gmail.com> writes:

> I personally think that scripting languages such as Acceleo (or xPand
> or similar) are ok just for very simple code generators because they
> cannot easily handle persistent datastructures. I cannot imagine
> writing a code generator for xUML or for synchronous languages in
> Acceleo...

I don't know Acceleo (clearly something to look at!), but from
experience with XSLT I'd say that it's much easier with model-to-model
transformations.

By that I mean, XSLT will easily translate XML to code if the structure
of the XML is a close match to that of the code. But if you omit (as I
did) the transformation from the structure that matches the UML tool's
needs to this more convenient structure, you end up doing a lot of work
in a language that's not well suited to it. For example, you wouldn't
want a state machine where the same event triggered more than one
transition from a given state. This and related checks took ~100 lines
of hairy XSLT in ColdFrame (http://coldframe.sourceforge.net/).



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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)
  0 siblings, 2 replies; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-09-04 14:51 UTC (permalink / raw)


Le Fri, 03 Sep 2010 18:14:47 +0200, Matteo Bordin  
<matteo.bordin@gmail.com> a écrit:
> You should use Acceleo 3, which complies with the OMG model-to-text
> spec.
That was because I first get into trouble with version 3, now it is solved.

To not give erroneous picture, here is the same with the relevant version.  
Indeed, this is different. Still did not found a way to have a nicer  
output (I did the best, but still not nice).


Transormation:

    [comment encoding = UTF-8 /]
    [module Generate('http://www.eclipse.org/uml2/3.0.0/UML')/]

    [template lined(s : String)]
    [s.trim().replaceAll('\\s+', ' ')/]
    [/template]

    [template indented(s : String)]
    [s.trim().replaceAll('(\\n)\\s+', '$0 ')/]
    [/template]

    [template asTypeName(e : NamedElement) post(lined())]
       [e.name/]_Type
    [/template]

    [template asParameter(p : Parameter) post(lined())]
       [p.name/] : [p.type.asTypeName()/]
    [/template]

    [template asNextParameter(p : Parameter) post(indented())]
    ;
    [p.asParameter()/]
    [/template]

    [template asFirstParameter(p : Parameter) post(lined())]
       [p.asParameter()/]
    [/template]

    [template asSelfParameter(o : Operation) post(lined())]
       Self : [o.ancestors(Class).asTypeName()/]
    [/template]

    [template asParameterList(o: Operation) post(indented())]
       ([o.asSelfParameter()/]
       [for (p : Parameter | o.eAllContents(Parameter))]
          [if (not p.name.equalsIgnoreCase('return'))]
             [p.asNextParameter()/]
          [/if]
       [/for])
    [/template]

    [template asSignature(o: Operation) post(indented())]
       [if (o.type = null)]
          procedure [o.name/]
          [o.asParameterList()/];
       [/if]
       [if (o.type <> null)]
          function [o.name/]
          [o.asParameterList()/]
          return [o.type.asTypeName()/];
       [/if]
    [/template]

    [template publicPart(pkg: Package) post(indented())]
       [for (c : Class | pkg.eAllContents(Class))]
          type [c.asTypeName()/] is private;

          [for (o : Operation | c.eAllContents(Operation))]
             [if (o.visibility = VisibilityKind::public)]
                [o.asSignature()/]
             [/if]
          [/for]
       [/for]
    [/template]

    [template privatePart(pkg: Package) post(indented())]
       [for (c : Class | pkg.eAllContents(Class))]
          type [c.asTypeName()/] is record
             [for (p : Property | c.eAllContents(Property))]
                [p.name/] : [p.type.asTypeName()/];
             [/for]
          end record; --  [c.asTypeName()/]

          [for (o : Operation | c.eAllContents(Operation))]
             [if (o.visibility <> VisibilityKind::public)]
                [o.asSignature()/]
             [/if]
          [/for]
       [/for]
    [/template]

    [template packageSpecification(pkg : Package) post(trim())]
    package [pkg.name/] is
       [pkg.publicPart()/]
    private
       [pkg.privatePart()/]
    end [pkg.name/];
    [/template]

    [template public Generate(pkg : Package)]
       [file (pkg.name + '.ads', false, 'UTF-8')]
    [pkg.packageSpecification()/]
       [/file]
    [/template]



Sample output, using the same UML model as for the prior example (the  
“indented” method does not seem to be enough).

    package Greetings is
       type Greeting_Box_Type is private;

                    procedure Say_Hi
                           (Self : Greeting_Box_Type
                           );
                    procedure Set_Greeting_Counter
                           (Self : Greeting_Box_Type
                                     ;
                                     Value : Natural_Type
                           );
                    function Get_Greeting_Counter
                           (Self : Greeting_Box_Type
                           )
                           return Natural_Type;
    private
       type Greeting_Box_Type is record
                    Greating_Counter : Natural_Type;
              end record; --  Greeting_Box_Type

                    procedure Have_A_Private_Time
                           (Self : Greeting_Box_Type
                           );
    end Greetings;


Useful link in this context:

    http://www.omg.org/spec/MOFM2T/1.0/
    for references about MTL (you will see indeed Acceleo 3 conforms to  
this, while 2.7 was not)

-- 
“Dual licensing is the Perl's way to disinfect the GNU General Public  
Virus!” (anonymous)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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)
  1 sibling, 0 replies; 47+ messages in thread
From: Matteo Bordin @ 2010-09-06  9:21 UTC (permalink / raw)



> That was because I first get into trouble with version 3, now it is solved.
>
> To not give erroneous picture, here is the same with the relevant version.  
> Indeed, this is different. Still did not found a way to have a nicer  
> output (I did the best, but still not nice).

Why don't you simply post process files with gnat pretty after
generation?

>
> Transormation:
>

A few comments, but you should go on the Acceleo web site for this:

> [for (p : Parameter | o.eAllContents(Parameter))]

This is highly un-optimized: you are looping over all elements
contained in an uml::Operation and checking for each of them if their
metatype is a (subtype of) uml::Parameter. What you really want to do
is:

[for (p : Paramenter | o.ownedParameter)]

that is, using the UML metamodel as a sort of grammar. The same
applies for looping over operations from a Class (ownedOperation) and
so on

Also note that Acceleo has a separator facility to separate the
printing of the elements of a sequence with a string but on the last
position (useful to print the ";" after all parameters but the last
one).



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  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)
  1 sibling, 0 replies; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-09-07 18:25 UTC (permalink / raw)


Le Sat, 04 Sep 2010 16:51:51 +0200, Yannick Duchêne (Hibou57)  
<yannick_duchene@yahoo.fr> a écrit:
> Useful link in this context:
>
>     http://www.omg.org/spec/MOFM2T/1.0/
>     for references about MTL (you will see indeed Acceleo 3 conforms to  
> this, while 2.7 was not)
And another, which is funny, as it show usage of Ada like comments ;)
http://www.omg.org/spec/OCL/2.2/
There are plenty of “--” in this doc
Seems they know about something and they were inspired after this.

Also time to reply a question posted in this thread about UML and SPARK :  
I would say there is a way to generate SPARK annotations from UML's OCL  
constraints.


-- 
“Dual licensing is the Perl's way to disinfect the GNU General Public  
Virus!” (anonymous)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: Ada and UML
  2010-08-31 10:12 Ada and UML Yannick Duchêne (Hibou57)
  2010-08-31 11:05 ` Yannick Duchêne (Hibou57)
  2010-08-31 18:25 ` Martin Krischik
@ 2010-09-10 20:13 ` Yannick Duchêne (Hibou57)
  2 siblings, 0 replies; 47+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-09-10 20:13 UTC (permalink / raw)


Le Tue, 31 Aug 2010 12:12:43 +0200, Yannick Duchêne (Hibou57)  
<yannick_duchene@yahoo.fr> a écrit:
Look there, AdaCore is part of the TopCased partners :)
http://www.topcased.org/index.php/content/view/32/49/
look, it's right at the top of the page (just seems there is a trouble  
with their logo).


-- 
“Dual licensing is the Perl's way to disinfect the GNU General Public  
Virus!” (anonymous)



^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2010-09-10 20:13 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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