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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b6e97963d32ee242 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-04 01:28:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!yellow.newsread.com!netaxs.com!newsread.com!newsfeed.stueberl.de!newsr1.ipcore.viaginterkom.de!btnet-peer1!btnet-peer0!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: john@nospam.demon.co.uk (John McCabe) Newsgroups: comp.lang.ada Subject: Re: The old "Object.Method" syntax debate Date: Wed, 4 Jun 2003 08:27:55 +0000 (UTC) Organization: BT Openworld Message-ID: <3eddac06.2014847@news.btclick.com> References: NNTP-Posting-Host: host217-37-177-69.in-addr.btopenworld.com X-Trace: hercules.btinternet.com 1054715275 5918 217.37.177.69 (4 Jun 2003 08:27:55 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Wed, 4 Jun 2003 08:27:55 +0000 (UTC) X-Newsreader: Forte Free Agent 1.21/32.243 Xref: archiver1.google.com comp.lang.ada:38573 Date: 2003-06-04T08:27:55+00:00 List-Id: On Tue, 3 Jun 2003 19:23:55 +0200, Lionel.DRAGHI@fr.thalesgroup.com wrote: >| That is a fair point, but it would be interesting to know how much of >| the Ada code written in under the 'object-oriented' paradigm actually >| uses a single tagged type per package. Over a period of around 3 years >| I worked in 2 separate companies where this was pretty much the case. >| In fact, in both cases the code structure was automatically generated. >I don't think it's a good practice. I find awkward to create create a child >for a class that perfectly fit in the same package. I don't really understand what you mean there. >Simple coding rules are good, but enforcing one class per package (and >calling it always "Object", or "Class") just bring Ada down to other >langages that do not have a strong modularity support and use classes for >this purpose. >Scattering strongly coupled classes on many packages lower readability. >And there is always a better name than "Object" or "Class". >Similarly, calling a formal "This" is, i think, a bad practice, there is >always a better name. >Automatically generated code often lead to this, not only because it >simplify the code generator, but because tools (and UML) do not provide >serious support for Ada modularity. >Most tools don't care, they just target C++ or Java, and so are mainly >"class translator". I agree to some extent with what you say here but, in the first company I mentioned the code generator was an in-house design written in Ada that used the output of [insert design tool name here :-)] generate the code. Although I said there was one tagged type per package, thinking back on it that wasn't quite true. The effect was something like that but there was a main tagged type relating to the actual functionality required, and a couple of tagged types relating to the overall structure and scheduling mechanisms (queues etc - tasks weren't used). In the second company I mentioned we used Rational Rose (UML). In this case we configured the tool to produce reaonable object and class names based on the classes we created. Having read a number of articles about using "Object" and "Class", as well as listening to a number of reasons from other team members why this was a daft idea, it was decided not to pursue that convention. Ultimately the "one tagged-type per class" mechanism wasn't 'enforced', but most of the packages came down to that and maintenance (with a couple of hundred packages) was fairly straightforward. Best Regards John McCabe To reply by email replace 'nospam' with 'assen'