comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Limited use for limited with?
Date: Sun, 10 Oct 2010 07:13:35 -0700 (PDT)
Date: 2010-10-10T07:13:35-07:00	[thread overview]
Message-ID: <c76f3559-7c89-4536-b92f-951da5a44170@m1g2000vbh.googlegroups.com> (raw)
In-Reply-To: i8p16f$sce$1@munin.nbi.dk

On 9 Paź, 08:13, "Randy Brukardt" <ra...@rrsoftware.com> wrote:

> Eventually, I changed most
> of "links" to use names, which are then looked up in an appropriate index.

And what's in the index? The index becomes a registry with the same
problems, just moved elsewhere. There are three options:

1. index/registry contains the actual objects - this has a big impact
on how the objects are created; this might impose limitations that
users will not want to accept
2. index/registry contains deep copies of the actual objects - then,
the updates will not be propagated
3. index/registry contains access values to actual objects - then,
beware dangling pointers
3a. objects know how to remove themselves from the index/registry -
this has a big impact on how the objects are destroyed and on how the
type is defined (forget interfaces); this in turn might impose
limitations that users will not want to accept, either

?

> A design that can't be expressed well in Ada is a poor design

So let's be constructive. The problem is the following:

- there is some activity happening in the environment that generates
stimulation that should be handled by the program
- there is some common interface for the propagation of this
stimulation
- users want to implement their handling routines

In short (hey, that's a candidate for a design pattern): Event
Handler.

Ada provides nice solution for interrupts, but not all such scenarios
are related to interrupts. Think about HTTP requests (AWS), RPC
invocations (PolyORB), alarm notifications, and so on - in many cases
all such things are delivered over the network, but this is not
necessary.

How would you express such a pattern in Ada? I still don't see a
plausible solution and declaring the one that is simplest, most
readable, and most flexible for the final user to be not "the Ada way"
is not constructive, either.

> I personally think that callbacks are a poor fit for Ada

So how to solve the above problem in Ada properly?

Or should we say that Ada is a poor fit for this class of problems
instead?

> It's not always
> possible to avoid them (i.e. GUI programming), but I don't think they should
> ever be introduced when there is an alternative.

So what is the alternative? Please do not repeat the ones that were
already dismissed.

--
Maciej Sobczak * http://www.inspirel.com



  reply	other threads:[~2010-10-10 14:13 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28  7:37 Limited use for limited with? Maciej Sobczak
2010-09-28  9:04 ` Alex R. Mosteo
2010-09-30  7:24   ` Stephen Leake
2010-09-30  9:21     ` Alex R. Mosteo
2010-09-28  9:18 ` Ludovic Brenta
2010-09-28 12:59   ` Maciej Sobczak
2010-09-28 13:45     ` Dmitry A. Kazakov
2010-09-28 21:57       ` Maciej Sobczak
2010-09-29  6:03         ` Ludovic Brenta
2010-09-29  8:25           ` Maciej Sobczak
2010-09-29  7:51         ` Dmitry A. Kazakov
2010-09-29  8:38           ` Maciej Sobczak
2010-09-29  9:16             ` Dmitry A. Kazakov
2010-09-29 12:22               ` Maciej Sobczak
2010-09-29 13:41                 ` Dmitry A. Kazakov
2010-09-29 15:07                   ` Georg Bauhaus
2010-09-29 19:22                     ` Dmitry A. Kazakov
2010-09-29 20:51                   ` Maciej Sobczak
2010-09-29 21:18                     ` Dmitry A. Kazakov
2010-10-05  7:35                     ` Randy Brukardt
2010-10-08  8:05                       ` Maciej Sobczak
2010-10-09  6:29                         ` Randy Brukardt
2010-10-05  7:25             ` Randy Brukardt
2010-10-08  8:23               ` Maciej Sobczak
2010-10-09  6:13                 ` Randy Brukardt
2010-10-10 14:13                   ` Maciej Sobczak [this message]
2010-10-11  6:23                     ` Randy Brukardt
2010-10-12 19:29                       ` Maciej Sobczak
2010-10-12 20:19                         ` Dmitry A. Kazakov
2010-10-13  2:09                         ` Randy Brukardt
2010-10-13  8:44                           ` Georg Bauhaus
2010-10-15  0:59                             ` Randy Brukardt
2010-10-13  9:43                           ` Maciej Sobczak
2010-09-28 15:15     ` Ludovic Brenta
2010-09-28 22:04       ` Maciej Sobczak
2010-09-28 15:54   ` Robert A Duff
2010-09-30  7:27   ` Stephen Leake
2010-09-30  7:33     ` Ludovic Brenta
2010-09-30 16:03     ` Adam Beneschan
2010-10-07 11:55       ` Stephen Leake
2010-10-07 18:27         ` Martin Krischik
2010-10-07 21:30           ` Adam Beneschan
2010-10-09  6:29             ` Martin Krischik
2010-10-09 18:35               ` Robert A Duff
2010-10-08  0:07           ` Randy Brukardt
2010-10-09  6:21             ` Martin Krischik
2010-09-28  9:32 ` Vadim Godunko
2010-09-28 11:34 ` stefan-lucks
2010-09-28 13:15   ` stefan-lucks
2010-09-28 16:55 ` Adam Beneschan
2010-09-28 17:31   ` Robert A Duff
2010-09-28 19:24     ` Adam Beneschan
2010-09-28 20:32       ` Vadim Godunko
2010-09-28 21:32         ` Adam Beneschan
replies disabled

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