From: mheaney@on2.com (Matthew Heaney)
Subject: Re: Ada Singleton Pattern
Date: 18 Sep 2004 21:19:17 -0700
Date: 2004-09-18T21:19:17-07:00 [thread overview]
Message-ID: <1ec946d1.0409182019.30467e1a@posting.google.com> (raw)
In-Reply-To: 414CAC2B.60400@y.com
Pylinius <p@y.com> wrote in message news:<414CAC2B.60400@y.com>...
> Luca Stasio wrote:
> > Hi, there is a way to implement the Singleton Pattern in Ada?
> > There are some examples out there?
> > Thanx.
>
> package Example_Of_Singleton is
>
> procedure Do_Something;
>
> procedure Do_Something_Else;
>
> end;
>
>
> Bring it on you stupid GangOfFour bastards, with your idiotic bloated
> idioms that inculcate and contaminate perfectly good alternative
> languages!
I alluded to this in my previous post. To be fair, though, you can do
this in C++ too:
namespace Example_Of_Singleton
{
void do_something();
void do_something_else();
}
One advantage of using a type is if the type is tagged. If there's a
singleton instance of type in the class, then you can use that as a
value of an object whose type is class-wide.
However, most of the time you don't need all of this infrastructure,
and the package/namespace technique is perfectly adequate.
-Matt
next prev parent reply other threads:[~2004-09-19 4:19 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-13 15:04 Ada Singleton Pattern Luca Stasio
2004-09-13 15:33 ` Dmitry A. Kazakov
2004-09-13 16:18 ` Luca Stasio
2004-09-13 17:01 ` Luca Stasio
2004-09-13 18:43 ` Martin Dowie
2004-09-13 19:37 ` Martin Dowie
2004-09-14 2:29 ` Steve
2004-09-14 8:52 ` Martin Dowie
2004-09-14 12:46 ` Jim Rogers
2004-09-14 13:57 ` Luca Stasio
2004-09-13 20:38 ` Georg Bauhaus
2004-09-14 8:17 ` Dmitry A. Kazakov
2004-09-14 13:56 ` Luca Stasio
2004-09-14 14:21 ` Florian Weimer
2004-09-14 14:48 ` Dmitry A. Kazakov
2004-09-14 15:04 ` Florian Weimer
2004-09-15 7:33 ` Dmitry A. Kazakov
2004-09-16 6:48 ` Florian Weimer
2004-09-16 7:45 ` Dmitry A. Kazakov
2004-09-14 15:38 ` Luca Stasio
2004-09-14 16:32 ` Florian Weimer
2004-09-14 17:43 ` Luca Stasio
2004-09-15 7:27 ` Martin Dowie
2004-09-15 19:38 ` Luca Stasio
2004-09-15 5:43 ` Matthew Heaney
2004-09-15 19:38 ` Luca Stasio
2004-09-18 21:47 ` Pylinius
2004-09-19 4:19 ` Matthew Heaney [this message]
2004-09-20 3:03 ` Pylinius
2004-09-23 7:35 ` Luca Stasio
2004-09-27 5:22 ` Pylinius
2004-09-27 8:05 ` Luca Stasio
2004-10-05 17:55 ` Luca Stasio
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox