From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4c17e6ae73bd8c51 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!h19g2000yqb.googlegroups.com!not-for-mail From: Matteo Bordin Newsgroups: comp.lang.ada Subject: Re: Ada and UML Date: Tue, 31 Aug 2010 09:34:11 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 212.99.106.125 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1283272451 4599 127.0.0.1 (31 Aug 2010 16:34:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 31 Aug 2010 16:34:11 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h19g2000yqb.googlegroups.com; posting-host=212.99.106.125; posting-account=0fK-ZgoAAACswzEJSZ3LA9AZ4FnRU7mX User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:13879 Date: 2010-08-31T09:34:11-07:00 List-Id: On Aug 31, 1:54=A0pm, Yannick Duch=EAne (Hibou57) wrote: > Le Tue, 31 Aug 2010 13:05:43 +0200, Yannick Duch=EAne (Hibou57) =A0 > a =E9crit:> Also, the Extend relationship, cou= ld be used to express the Ada's child =A0 > > package relationship. But I am not sure this is valid UML to use the = =A0 > > extend relation between two UML packages. > > > And what about the Composition relationship to express Ada's nested =A0 > > package relationship ? > > To be more exact, UML Name Space should be used instead of UML Package, a= s =A0 > Ada's package are both package and name-space at a time. Just have to hop= e =A0 > that Name Space is interpreted as a special case of Package for everyones= , =A0 > 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=3Dtrue) UML singleton class. Package-level variables, constants and non-primitive operations can be mapped as static features (isStatic=3DTrue) 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