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,CP1252 Path: g2news1.google.com!postnews.google.com!i31g2000yqm.googlegroups.com!not-for-mail From: Matteo Bordin Newsgroups: comp.lang.ada Subject: Re: Ada and UML Date: Wed, 1 Sep 2010 01:20:30 -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=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1283329230 5591 127.0.0.1 (1 Sep 2010 08:20:30 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 1 Sep 2010 08:20:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i31g2000yqm.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:13891 Date: 2010-09-01T01:20:30-07:00 List-Id: > > > 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 =93be fair=94 requirement in m= ind. > While I should not have used the =93formal=94 qualifier, you are right (f= ormal > 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 th= e > 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 =93only use the ~ visibility modifier= =94. > 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 sam= e > thing: UML profile means possibly adding notational components to UML via > prototypes, while Ada profile means strict subset of Ada, don't even thin= k > 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() =3D 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=3Dtrue) 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=3DTrue) 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=3Duml2tools, 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 =E0-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).