comp.lang.ada
 help / color / mirror / Atom feed
From: rjh@cs.purdue.EDU (Bob Hathaway)
Subject: Good Design Strategies <Was comments on comments>
Date: 23 Feb 89 22:50:07 GMT	[thread overview]
Message-ID: <6100@medusa.cs.purdue.edu> (raw)
In-Reply-To: 2325@goofy.megatest.UUCP

In article <2325@goofy.megatest.UUCP>, djones@megatest.UUCP (Dave Jones) writes:
> In an article by rjh@cs.purdue.EDU, Bob Hathaway says that he usually
> uses ADT's to do top-down design and implementation...

Umm, the method presented was better categorized as a modular design
strategy with abstract data types.  The implementation strategy was
Adt/object oriented because coding began by implementing the Adts.  In 
top-down/bottom-up terminology this corresponds to top-down design with
bottom-up implementation.  This strategy can be applied recursively
to Adts with the top level object as the starting point in design
and the bottom level sub-objects as the starting points in implementation.
We know that we need an intermediate code Adt, which may require a generic
tree Adt, which may require a generic list Adt, and so on.  It seems
natural to first identify the intermediate code Adt as necessary in the
overall system design but to begin its implementation at the bottom level
by using generic components.

Since the following is long, I'll ask here.  It would be interesting to see
some discussion on design strategies; any interesting opinions or experiences?

> I too have been designing all my programs around "abstract data-types"
...
> But I don't usually do top-down.  I do bottom-up.  Design, implementation,
> test, everything.  It actually shocks some people when I say that. In the
> seventies "bottom-up" became a dirty word.  Never mind that top-down
> methods resulted in some of the most inflexible code every put to disk.
> Top-down good. Bottom-up bad. Unnngghh. :-)

What you describe sounds like an Adt/object oriented implementation, I'm not
sure if the bottom-up arguments apply.

> I'll freely admit, there are times when top-down is the way to go.  But
> it's not the way I do most of the programs I write by myself.
> 
> I start out with a "bottom" that consists of lots of -- okay, I'll go 
> along with the name -- ADT's which are likely to be of use in just 
> about any kind of program: lists, queues, hash-tables, avl-trees, 
> flexible buffers, priority queues and so on.  Next I use these to form 
> ADT's which are specific to the low-level objects under consideration, 
> etc.  And so it goes from bottom to top.  The payoff comes when you want
> to change something. All you have to do is reshuffle these building blocks,
> which are still quite useful. But if you go from the top to the bottom, 
> a change at the top is likely to invalidate the whole blasted thing.

The standard argument for top-down design is that design errors are caught
early.  A top level change could make all the work done at the bottom level
unnecessary and major rewriting or complete scrapping could occur.  That
is the advantage of top-down design with bottom-up implementation, the
overall design should be close to correct and the implementation is direct
and fast because the objects and procedures don't depend on anything not
yet implemented.  I think the advantage of "building blocks" should be
evident in any design since code which is designed to be easy to modify
will consist of reusable and parameterized components which correspond
to a loosly coupled and highly cohesive modular design.

> I sometimes carry it to unlikely extremes.   My group is writing a Pascal 
> compiler. If ever there seemed to be a top-down kind of task, that seemed to be
> it.  I mean, Pascal is already done, for Pete's sake.  There are standards
> documents which tell you what a Pascal compiler absolutely *has* to do. But..
> I started out with my bag of standard ADT's anyway, and then defined some
> more: Pascal blocks, types, parms, variable-accesses...  just about
> every kind of Pascal-object you can think of.  One by one we implemented
> them as we worked our way up to type-definitions, expression-trees, statements.
> The methods for these ADT's went into a library.
> 

This sounds like a bottom-up implementation, but since the upper levels
(objects) were already known in advance, a top-down design (loosly speaking).

>It was only a matter of a few weeks, long before the compiler's high level
>was anywhere near finished, that it paid off.  Another group was doing
>a mouse-driven frontend for the interactive embedded compile/load/go
>feature that we have.  They needed to be able to capture all of the
>type-information, formal parameters and so forth about the program being
>run, then fish around in it finding all the variables of this type,
>building all the short expressions that are assignment compatible to the
>second formal parm of procedure foo, etc..
>...
>
>Try doing that with a Pascal compiler that was designed top-down to
>be a Pascal compiler.

It sounds like the bottom-up implementation provided them with the working
software early.  A good design will provide reusable components which are
easy to modify regardless of the implementation.

Bob Hathaway
rjh@purdue.edu

  reply	other threads:[~1989-02-23 22:50 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1813@goofy.megatest.UUCP>
1989-02-10 21:16 ` comments on comments Bob Hathaway
     [not found] ` <20233@agate.BERKELEY.EDU>
     [not found]   ` <9689@ihlpb.ATT.COM>
1989-02-23  2:15     ` Bob Hathaway
1989-02-23  7:22       ` Dave Jones
1989-02-23 22:50         ` Bob Hathaway [this message]
1989-02-25  1:07           ` Good Design Strategies <Was comments on comments> Dave Jones
1989-02-26 19:34             ` Rob Jellinghaus
1989-02-27  0:58               ` William Thomas Wolfe,2847,
1989-02-27 15:29                 ` John Baugh
1989-02-27 18:29                 ` Reuseable Ada components William Thomas Wolfe,2847,
1989-02-28  0:53             ` Good Design Strategies <Was comments on comments> Bob Hathaway
1989-02-28 22:13               ` Dave Jones
1989-03-03  5:45                 ` Bob Hathaway
1989-03-08 17:14                   ` David P. Schneider
1989-03-11 11:15                   ` Stuart H. Ferguson
1989-02-24  1:57         ` comments on comments William Thomas Wolfe,2847,
1989-02-23 20:41       ` comments on comments on reusability Rick Farris
1989-02-24  2:15         ` comments on comments on comments William Thomas Wolfe,2847,
1989-02-24  3:31           ` William A. Bralick
1989-02-24  9:24           ` Rick Farris
1989-02-25 14:28           ` Robert Claeson
1989-03-09 21:12           ` Rick Clements
1989-02-27  9:09 Good Design Strategies <Was comments on comments> Erland Sommarskog
1989-02-27 15:46 ` William Thomas Wolfe,2847,
1989-02-27 17:07   ` Mike Coffin
1989-02-28  4:16     ` Steven D. Litvintchouk
1989-02-28  4:11   ` Steven D. Litvintchouk
1989-03-04  1:25     ` Robert A. Agnew
1989-02-28 11:23   ` Mikael Eriksson
1989-03-01 22:25     ` William Thomas Wolfe,2847,
1989-03-02 22:14       ` Michael Schwartz
1989-02-28 12:22   ` Robert Claeson
1989-02-28  1:16 ` Bob Hathaway
1989-02-28  4:55   ` Rob Jellinghaus
1989-02-28 22:35     ` Dave Jones
replies disabled

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