comp.lang.ada
 help / color / mirror / Atom feed
From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Re: Generic package parameters not externally visible : what's the rational ?
Date: Thu, 29 Oct 2009 05:18:26 -0700 (PDT)
Date: 2009-10-29T05:18:26-07:00	[thread overview]
Message-ID: <7e99bb5a-26a8-4ccb-b8d0-3b6882c40ebe@k17g2000yqb.googlegroups.com> (raw)
In-Reply-To: hca4q0$jju$1@munin.nbi.dk

On 28 oct, 20:07, "Randy Brukardt" <ra...@rrsoftware.com> wrote:
> Surely I have a feeling of confusion :-) at the idea of having a generic
> package with a large number of interelated formal packages. That sounds a
> new way to create unmaintainable spagetti code (gotos aren't the only way to
> make things impossible to understand). That's irrespective of how the
> formals on the outer package are named.
>
>                                    Randy.

In return, you've just frightened me (not less) with that “ Surely I
have a feeling of confusion :-) at the idea of having a generic
package with a large number of interelated formal packages ”. Sounds
to me like if you attempted to make me understand I'm making a *big*
design mistake.

May I say gotos are sometime considered not so much evil, but it is
not the spot here

The same coupling between formal packages do exist, even if it's less
visible, with other packages because they are not generic. I attempt
an example : let say we want a package whose intent is to search
matches of some kind of patterns in strings. We feel its something
which is finally somewhat universal, and we decide to make it a
generic package, working on arrays of discrete type items. So instead
of a package working on strings, we create a generic package, with a
formal type parameter, which will be instantiated with
Standard.Character or Standard.Wide_Wide_Character for the initial
purpose. Then, we later wish some helpers to log statistics on
patterns and sequences which matched each others (an example, do not
expect it to be clearly useful at first sight, just imagine it is
useful to someone). This helper package must work with the same type
of data the pattern-matching package use. It will have a pattern-
matching package as one of its formal parameters, and for clarity, we
may add the discrete type to its parameters as well, to clearly show
they have this type in common. Imagine now (my own imagination has
exhausted at this point, so imagine what you want), we have a second
helpers, which is related to the first package the same the other
helper package is, and again another package, which has this time,
dependencies to the two helpers package.

This may seems “ complex ”, but this is not more than any other stuff
of the same area, like data flow, code flow or the like. If relations
and dependencies are clear and coherent, what is like spaghettis
here ?

Another advocating based on a comment after the previous example :
with non-generic, you would just see multiple packages each holdings a
reference to Standard.Wide_Wide_Character, thus you will not feel
there are coupled, but just related to Standard.Wide_Wide_Character.
There, as they are all generics, you see them all depending each
others, to be sure they all use some one type in common. This seems
complex, because a dependency is clearly reported and stated, while
this is not clearly stated with non-generic (this would just be fact
someone may notice after analysis), but relations are finally still as
much complex, and they are the same in both case (generic, and non-
generic case).

I do not mean you comment is wrong, I just attempt to reply and
advocate an view on the situation.

If I'm surely wrong on the long time, I want to know before I discover
it myself after a (too much) long time



  reply	other threads:[~2009-10-29 12:18 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-26  8:58 Generic package parameters not externally visible : what's the rational ? Hibou57 (Yannick Duchêne)
2009-10-26 11:05 ` Ludovic Brenta
2009-10-26 15:02   ` Robert A Duff
2009-10-27  1:06   ` Hibou57 (Yannick Duchêne)
2009-10-26 14:56 ` Robert A Duff
2009-10-27  3:03   ` Hibou57 (Yannick Duchêne)
2009-10-27 21:08   ` Randy Brukardt
2009-10-27 21:36     ` Jeffrey R. Carter
2009-10-27 22:03       ` Hibou57 (Yannick Duchêne)
2009-10-27 22:19         ` Jeffrey R. Carter
2009-10-28 19:07         ` Randy Brukardt
2009-10-29 12:18           ` Hibou57 (Yannick Duchêne) [this message]
2009-10-29 22:56             ` Randy Brukardt
2009-10-30  0:10               ` Hibou57 (Yannick Duchêne)
2009-10-27 22:04       ` Hibou57 (Yannick Duchêne)
2009-10-27 23:37       ` Robert A Duff
2009-10-27 23:41         ` Jeffrey R. Carter
2009-10-27 23:34     ` Robert A Duff
2009-10-28  2:19       ` Hibou57 (Yannick Duchêne)
2009-10-28 19:12         ` Randy Brukardt
2009-10-29  7:34           ` Stephen Leake
2009-10-29 12:21           ` Hibou57 (Yannick Duchêne)
2009-10-29 13:10             ` AdaMagica
2009-10-29 15:11               ` Georg Bauhaus
2009-10-29 19:28                 ` Jeffrey R. Carter
2009-10-29 20:27                   ` Georg Bauhaus
2009-10-30 10:30               ` Stephen Leake
2009-10-30 17:53             ` Ludovic Brenta
2009-10-31  2:10               ` Hibou57 (Yannick Duchêne)
2009-10-30  5:19           ` Hibou57 (Yannick Duchêne)
2009-10-28  9:09     ` Dmitry A. Kazakov
2009-10-28 19:19       ` Randy Brukardt
2009-10-29  8:36         ` Dmitry A. Kazakov
2009-10-29 23:03           ` Randy Brukardt
2009-10-30  8:51             ` Dmitry A. Kazakov
2009-10-30 10:25           ` Stephen Leake
2009-10-30 19:32             ` Dmitry A. Kazakov
2009-10-31  2:06               ` Hibou57 (Yannick Duchêne)
2009-10-31  9:14                 ` Dmitry A. Kazakov
2009-11-03  8:25                   ` Hibou57 (Yannick Duchêne)
2009-11-03  9:59                     ` Dmitry A. Kazakov
2009-11-05 10:38                       ` Hibou57 (Yannick Duchêne)
2009-11-05 11:00                         ` Dmitry A. Kazakov
2009-11-05 12:16                           ` Hibou57 (Yannick Duchêne)
2009-11-05 14:09                             ` Dmitry A. Kazakov
2009-11-06 12:19                               ` Hibou57 (Yannick Duchêne)
2009-11-06 13:27                                 ` Dmitry A. Kazakov
2009-10-31  2:08               ` Hibou57 (Yannick Duchêne)
2009-10-31 12:44               ` Stephen Leake
2009-11-01 11:37                 ` Dmitry A. Kazakov
replies disabled

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