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=-1.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,1d52a75fd633fefc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-13 22:28:58 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!news-hog.berkeley.edu!ucberkeley!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.bc.tac.net!news.bc.tac.net!not-for-mail Sender: blaak@blight.transcend.org Newsgroups: comp.lang.ada Subject: Re: UML (Was: Ada to C++ translator?) References: <3A844255.24A4DBA3@lmco.com> <968vnc$5a2$1@nnrp1.deja.com> From: Ray Blaak Message-ID: X-Newsreader: Gnus v5.7/Emacs 20.7 Date: 13 Feb 2001 22:19:29 -0800 NNTP-Posting-Host: 207.34.170.101 X-Complaints-To: news@bctel.net X-Trace: news.bc.tac.net 982131950 207.34.170.101 (Tue, 13 Feb 2001 22:25:50 PST) NNTP-Posting-Date: Tue, 13 Feb 2001 22:25:50 PST Xref: supernews.google.com comp.lang.ada:5249 Date: 2001-02-13T22:19:29-08:00 List-Id: "Ken Garlington" writes: > "Frode Tenneb�" wrote in message news:ddo969.8qa.ln@leia... > : And if it can do Ada -> UML -> Ada, why should it not manage > : Ada -> UML -> C++ (or more desireable, C++ -> UML -> Ada)? One of the realities of modeling in UML is that you can never become completely independent of the target language. For example, one tends to name things using the style of the target language (e.g Do_Something vs DoSomething vs doSomething), and one tends to use when necessary the primitive types of the target language for attribute types, return and parameter types (e.g. Integer vs int, empty return type vs "void"). E.g. a UML method destined for Ada might look like this on a UML diagram: Do_Something(Right_Now : Integer) for Java: doSomething(rightNow : int) : void The types especially are the real problem. As the primitive types vary from language to language, and as UML does not have any such primitive types, there is no standard with which a code generator or reverse engineering tool could automatically translate things. Other nits: default parameters (Java doesn't have them, Ada and C++ do), overall UML representation (C++ and Java use classes almost exclusively, Ada, technically speaking has only packages, types, and routines -- the class structure in UML for Ada has to follow some sort of convention), target language types that don't map to UML (e.g. Ada's array types also need to have some sort of convention to map them on to UML classes). All these things directly affect the contents of the UML model, and the conventions of representing UML for one language does not necessarily or even usually apply to the conventions for another language. The best you can do (and I have done this myself) is to reverse engineer into UML, and run some sort script on the UML model to translate the primitive types and conventions over. -- Cheers, The Rhythm is around me, The Rhythm has control. Ray Blaak The Rhythm is inside me, blaak@infomatch.com The Rhythm has my soul.