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-Thread: 103376,eafb0c0f59b030c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Event mechanisms for GUI's References: <3egSg.208528$1i1.141541@attbi_s72> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1159326161 12.201.97.213 (Wed, 27 Sep 2006 03:02:41 GMT) NNTP-Posting-Date: Wed, 27 Sep 2006 03:02:41 GMT Date: Wed, 27 Sep 2006 03:02:41 GMT Xref: g2news2.google.com comp.lang.ada:6764 Date: 2006-09-27T03:02:41+00:00 List-Id: tmoran@acm.org wrote: >> There's nothing wrong with case statements. They're very clear and easy > In small quantity, yes. But many-branched, nested, case statements with > a lot of near duplication are not so clear or maintainable. They are > a very low abstraction level, computer-centric, device. > If This_Window is for showing danger warnings in big red letters to the > reactor operator, and That_Window is for showing daily power demand over > the last month, a mouse click in either is similar from a computer-centric > view, but vastly different in the problem space. Having This_Window_Type > objects and That_Window_Type objects as descendants of Basic_Window_Type > (inheriting what they have in common) makes them different objects, and a > dispatching call on When_Left_Button_Down(The_Clicked_Window) is in effect > a succinct abbreviation for a case statement on the type of Window, > implemented efficiently and without forgetfullness or typing errors, > automatically by the compiler. Sacrificing ease of reading for ease of writing. -- Jeff Carter "My mind is aglow with whirling, transient nodes of thought, careening through a cosmic vapor of invention." Blazing Saddles 85