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-Thread: 103376,21960280f1d61e84 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.net!prodigy.net!newsdst01.news.prodigy.net!prodigy.com!postmaster.news.prodigy.com!newssvr27.news.prodigy.net.POSTED!4988f22a!not-for-mail From: Newsgroups: comp.lang.ada References: <1169636785.504223.139630@j27g2000cwj.googlegroups.com> <45b8361a_5@news.bluewin.ch> <3pejpgfbki.fsf@hod.lan.m-e-leypold.de> <1sh134r4r8piq$.wh1w0uitf99t$.dlg@40tude.net> Subject: Re: How come Ada isn't more popular? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Message-ID: <83ozh.25895$yC5.16628@newssvr27.news.prodigy.net> NNTP-Posting-Host: 70.134.135.166 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr27.news.prodigy.net 1171131716 ST000 70.134.135.166 (Sat, 10 Feb 2007 13:21:56 EST) NNTP-Posting-Date: Sat, 10 Feb 2007 13:21:56 EST Organization: SBC http://yahoo.sbc.com X-UserInfo1: TSU[@I_A\S@QBTLYYZH@^SXBUSXB@DTMNHWB_EYLJZ]BGIELCNSKQFCY@TXDX_WHSVB]ZEJLSNY\^J[CUVSA_QLFC^RQHUPH[P[NRWCCMLSNPOD_ESALHUK@TDFUZHBLJ\XGKL^NXA\EVHSP[D_C^B_^JCX^W]CHBAX]POG@SSAZQ\LE[DCNMUPG_VSC@VJM Date: Sat, 10 Feb 2007 18:21:56 GMT Xref: g2news2.google.com comp.lang.ada:9232 Date: 2007-02-10T18:21:56+00:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1sh134r4r8piq$.wh1w0uitf99t$.dlg@40tude.net... > On Fri, 09 Feb 2007 07:50:43 -0500, Robert A Duff wrote: > >> Maciej Sobczak writes: >> >> >> Why is that superior to just using functions as constructors? >> Ada has: >> >> type T(<>) is ... >> >> to indicate that clients MUST call some constructor function when >> creating objects. And it now allows constructor functions (and >> aggregates) for limited types. > > Because it does not compose upon inheritance and aggregation. > > When inherited the constructing function need to be overridden, even if > null record was the only thing added. Further one can barely publicly > derive anything from T, which breaks encapsulation. > I guess I don't see this as a serious problem. Perhaps this is because I frequently take the Modula-2 approach and create opaque types. These support extensible inheritance, enforce encapsulation, and separate all the implementation details within the package body. Granted, the use of opaque types requires the supporting capability of access types. But the use of access types in the pursuit of good programming is no vice. Rather, it is consistent with the counsel given us over two score years ago by Maurice Wilkes. >From my perspective, opaque types solve a lot of problems that are inherent in C++ and Java and support an increased level of separation of concerns in my application architecture. That being said, one can, with a little effort, create C++ opaque types. I have not thought about how this would be done in Java. Pehaps through the interface mechanism. Richard