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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b88383a5d9c51aa0 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!npeer.de.kpn-eurorings.net!npeer-ng1.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada-Singleton-Why does it work like this? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <5a7a870c-40e2-4803-8753-0f9cfd2b800f@k2g2000yql.googlegroups.com> <13su65cm8b5ov$.1198qla32cc3i$.dlg@40tude.net> Date: Wed, 25 Mar 2009 12:10:26 +0100 Message-ID: <1bf21w38d0xy6.1jeyl0h376pe7.dlg@40tude.net> NNTP-Posting-Date: 25 Mar 2009 12:10:26 CET NNTP-Posting-Host: 6568878f.newsspool4.arcor-online.net X-Trace: DXC=kO[=P1OlTU^Fm0Y?OE@2^X4IUKkgRl@42MbZ?HC[ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:5259 Date: 2009-03-25T12:10:26+01:00 List-Id: On Wed, 25 Mar 2009 03:07:18 -0700 (PDT), patrick.gunia@googlemail.com wrote: > Maybe I�m getting something wrong, but from my point of view, > Singleton offers more possibilities than just the execution of some > code on elaboration of some module.I like the dynamic version Ludovic > described. It also offers the possibility to change the number of > instances later on and thus increases the adaptability. Sorry, but a singleton with more than one instance is not a singleton. > When you say > that Singleton isn�t necessary in Ada this might come from the fact > that it can�t be implemented as in other languages, though using such > a construct might increase readability of the code. No, it is rather so, that the problems solved in other languages using the singleton pattern, in Ada are solved using different patterns. There is a general note about software design patterns, that they usually indicate some language deficiency. If a language has a construct to express the idea behind the pattern, then it is not a pattern anymore. Pattern assumes some manual, yet routine work on the programmer side, which cannot be taken over by the language, because ... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de