comp.lang.ada
 help / color / mirror / Atom feed
From: Martin <martin.dowie@btopenworld.com>
Subject: Re: Ada-Singleton-Why does it work like this?
Date: Thu, 26 Mar 2009 02:04:08 -0700 (PDT)
Date: 2009-03-26T02:04:08-07:00	[thread overview]
Message-ID: <e5159d67-531d-4053-acc2-6c9c293ca972@j39g2000yqn.googlegroups.com> (raw)
In-Reply-To: at3dqg.dj6.ln@hunter.axlog.fr

On 25 Mar, 11:17, Jean-Pierre Rosen <ro...@adalog.fr> wrote:
> I think there is a contradiction between "class" and "singleton". The
> term "class" is used, because it includes a set of objects that are
> equivalent for some point of view, i.e. a mathematical equivalence class.
>
> Now, if the class gathers only one object, the equivalence relationship
> does not make much sense...

It is a set - it just has a single member.

I think Singleton-as-a-type is useful if and only if you wish to
retain behavours you can acheive with other classes, e.g it may be
useful to mix in "stream-ability" or even polymorphism - e.g. you know
you can only have a single modem in your system but you may need to
have different modems (e.g. Hayes v. Alcatel. v. whoever).

Now in Ada we are used to doing that sort of thing via package renames
and compilation options. But perhaps that isn't an option in system
where modems can be replaced between power-down/power-ups.

Again, we used to seeing a different style of solving that problem in
Ada but that's not to say that solutions used in other languages
shouldn't be looked at on their own merits.

Perhaps the Patterns Working Group of the ACM could provide classic-
Ada-style v. GoF-style presentation? Or is it really that defunct?

Cheers
-- Martin



  reply	other threads:[~2009-03-26  9:04 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-24 19:01 Ada-Singleton-Why does it work like this? patrick.gunia
2009-03-24 19:10 ` Pascal Obry
2009-03-24 20:47 ` Jeffrey R. Carter
2009-03-25  0:10   ` Martin
2009-03-25  0:41     ` Jeffrey R. Carter
2009-03-25  9:30     ` Dmitry A. Kazakov
2009-03-26  8:55       ` Martin
2009-03-26  9:28         ` Dmitry A. Kazakov
2009-03-26 13:39           ` Maciej Sobczak
2009-03-26 14:07             ` Georg Bauhaus
2009-03-26 14:33               ` Dmitry A. Kazakov
2009-03-26 15:22                 ` Georg Bauhaus
2009-03-26 16:31                   ` Dmitry A. Kazakov
2009-03-26 14:28             ` Dmitry A. Kazakov
2009-03-26 22:00               ` Maciej Sobczak
2009-03-27 10:02                 ` Dmitry A. Kazakov
2009-03-25 22:29   ` sjw
2009-03-24 20:52 ` Ludovic Brenta
2009-03-25  9:59   ` patrick.gunia
2009-03-25 10:29     ` Jean-Pierre Rosen
2009-03-25 11:26     ` Georg Bauhaus
2009-03-25 11:49       ` patrick.gunia
2009-03-29  7:29     ` Jacob Sparre Andersen
2009-03-24 21:21 ` Dmitry A. Kazakov
2009-03-25 10:07   ` patrick.gunia
2009-03-25 10:57     ` patrick.gunia
2009-03-25 11:40       ` Georg Bauhaus
2009-03-25 11:46       ` Ludovic Brenta
2009-03-25 11:55         ` patrick.gunia
2009-03-25 14:10         ` patrick.gunia
2009-03-25 14:40           ` Ludovic Brenta
2009-03-25 15:16             ` Adam Beneschan
2009-03-25 15:19             ` patrick.gunia
2009-03-25 16:52               ` Georg Bauhaus
2009-03-25 11:10     ` Dmitry A. Kazakov
2009-03-25 11:37       ` patrick.gunia
2009-03-25 12:07         ` Ludovic Brenta
2009-03-25 15:00         ` Robert A Duff
2009-03-25 11:17     ` Jean-Pierre Rosen
2009-03-26  9:04       ` Martin [this message]
2009-03-25 11:38     ` Ludovic Brenta
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox