From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a04e500922557815 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-15 05:30:59 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsengine.sol.net!wn1feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3CE2540C.1030404@worldnet.att.net> From: Jim Rogers User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Need advice: Enumerate or not References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 15 May 2002 12:26:50 GMT NNTP-Posting-Host: 12.75.144.109 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1021465610 12.75.144.109 (Wed, 15 May 2002 12:26:50 GMT) NNTP-Posting-Date: Wed, 15 May 2002 12:26:50 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:24091 Date: 2002-05-15T12:26:50+00:00 List-Id: 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