comp.lang.ada
 help / color / mirror / Atom feed
From: Jim Rogers <jimmaureenrogers@worldnet.att.net>
Subject: Re: Need advice: Enumerate or not
Date: Wed, 15 May 2002 12:26:50 GMT
Date: 2002-05-15T12:26:50+00:00	[thread overview]
Message-ID: <3CE2540C.1030404@worldnet.att.net> (raw)
In-Reply-To: slrnae4bam.o4.randhol+abuse@kiuk0152.chembio.ntnu.no

Both approaches will work.

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. On the other hand, the dispatching
approach reduces maintenance cost and explicit complexity.

Jim Rogers




  reply	other threads:[~2002-05-15 12:26 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 [this message]
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
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