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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5394d9ca5f955366 X-Google-Attributes: gid103376,public From: Simon Wright Subject: Re: pointers & OOP Date: 1999/05/06 Message-ID: #1/1 X-Deja-AN: 474626678 X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 References: <$DL10CAsSgL3Iwj3@jr-and-assoc.demon.co.uk> <7gn7gr$fr5$1@nnrp1.dejanews.com> X-Trace: news.demon.co.uk 925970883 nnrp-12:7508 NO-IDENT pogner.demon.co.uk:158.152.70.98 Organization: At Home Newsgroups: comp.lang.ada X-Complaints-To: abuse@demon.net Date: 1999-05-06T00:00:00+00:00 List-Id: John Robinson writes: > Hence, a mapping from UML to Ada 95 should always map a single UML > class box onto a package containing a single tagged type. Although > the language allows multiple tagged types to be declared in a single > package it makes no sense whatsoever to do so. It may make sense to have such a rule with regard to public types. Indeed, you need some such translation rules between the UML and the Ada or you are going to get lost (I suppose you could have a 'design' stage, where you map the UML onto the Ada using some other formalism; I don't know enough about UML, perhaps it has this technology inbuilt). Perhaps there could be a set of patterns for recognising UML clusters that should be translated into Ada using multiple-types-in-one-package. However, I can see no need to restrict yourself with regard to private types! of course, they are implementation support and so not likely to appear in the UML anyway .. I'm not holding out the Booch Components (well, anyway, the Ada95 version) as a stunning example of design, but consider the Graphs package: generic [...] package BC.Graphs is [...] type Graph is abstract new Ada.Finalization.Limited_Controlled with private; type Graph_Ptr is access all Graph'Class; type Vertex is abstract new Ada.Finalization.Controlled with private; type Arc is abstract new Ada.Finalization.Controlled with private; Clearly these three things are intimately intertwingled!