🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #773

Re: LabelUI and ComponentUI

#773
From: John McGrath TeamB
Date: Wed, 16 Oct 2002 07:48
32 lines
2149 bytes
On Mon, 7 Oct 2002 12:09:23 -0400, Jean Bresse wrote:

> Why would the API have a LabelUI class is while extending 
> ComponentUI it offers no additional methods, properties,
> constructors, or overwritten methods.

There are some standard methods that UI components are supposed to have 
that fit the standard pattern.  For example, the JLabel class has the 
following methods:

    public LabelUI getUI();
    public void setUI(LabelUI ui);

If a JLabel used a ComponentUI, the signatures for these methods would 
have to change.  That would preclude changes to the interaction between 
a JLabel and its UI delegate.  Also, ComponentUI is an abstract class, 
so that would also have to change.

It makes a lot more sense to define a pattern and then stick with it, 
even if it does not seem the most efficient thing to do in some cases.  
If you break the pattern, you often end up jumping through hoops later 
on to deal with the exception cases.  The result is that deviating from 
the pattern often ends up making things less efficient.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.1816e3c087dc956f98ba92@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!colt.net!newspeer.clara.net!news.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3da1b1b2$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,466fc8b3e7cf4dfa
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-10-16 01:22:03 PST
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: LabelUI and ComponentUI
Date: Wed, 16 Oct 2002 03:48:04 -0400
Message-ID: <MPG.1816e3c087dc956f98ba92@newsgroups.borland.com>
References: <3da1b1b2$1@newsgroups.borland.com>
X-Newsreader: MicroPlanet Gravity v2.60
NNTP-Posting-Host: 151.197.228.139
X-Trace: newsgroups.borland.com 1034754483 151.197.228.139 (16 Oct 2002 00:48:03 -0700)
Lines: 32
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!colt.net!newspeer.clara.net!news.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail