comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: Need advice: Enumerate or not
Date: Wed, 15 May 2002 18:00:35 GMT
Date: 2002-05-15T18:00:35+00:00	[thread overview]
Message-ID: <3CE2A23D.850BA244@acm.org> (raw)
In-Reply-To: 3CE2540C.1030404@worldnet.att.net

Jim Rogers wrote:
> 
> The use of enumerated types is clearly more of an Ada 83 design
> pattern. Its limitation is that you must update the source code
> for the Update procedure when new options are permitted.
> 
> The use of dispatching is clearly more of an Ada 95 design
> pattern. Its main advantage is that you never need to change
> the Update procedure taking a parameter of type
> "access Gtk_Frame_Record'Class". All you need to do is override the
> Update procedure for the new child type of Gtk_Frame_Record.
> 
> The Ada 95 approach is perhaps harder to read, because all the
> decisions are performed by dispatching and not by explicit
> branching in your code.

To summarize, enumeration types are easier to read but require writing
more code. Dispatching (OOP) is harder to read but requires less coding.

Ada has as an explicit design goal of emphasizing ease of reading over
ease of writing. Thus Rogers' statements support the claim that
dispatching is not in the spirit of Ada.

-- 
Jeff Carter
"Go and boil your bottoms."
Monty Python & the Holy Grail



  parent reply	other threads:[~2002-05-15 18:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-15  9:42 Need advice: Enumerate or not Preben Randhol
2002-05-15 12:26 ` Jim Rogers
2002-05-15 14:24   ` Preben Randhol
2002-05-16 13:03     ` Stephen Leake
2002-05-16 19:05       ` Preben Randhol
2002-05-15 18:00   ` Jeffrey Carter [this message]
2002-05-16  0:31     ` Jim Rogers
2002-05-16  2:37     ` Robert Dewar
2002-05-16 10:22       ` Preben Randhol
2002-05-16 17:36       ` Jeffrey Carter
replies disabled

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