Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] ordering problem adding buttons to a GridLayout



"Brad O'Hearne" <brado@xxxxxxxxxxxxx> wrote on 22/10/2003 13:30:15:

> > 2) From the SWT Home Page, "SWT component is designed to provide
> > efficient, portable, access to the user-interface facilitites of
> > the operating system", not facilitate GUI builders.
>
> I'm not going to debate this one with you, but this statement doesn't
> preclude or forbid thoughtful design decisions to facilitate easier use of
> the API.  I have a hard time believing the SWT effort was launched with a
> staunch "developer programming only" intent and aimed to be deaf to the
> concerns of API usage.  Perhaps it is a style choice, perhaps it is
> something more significant, but that will remain a matter of opinion I
> suppose.  I read the last thread many months ago on this, and if history
> serves, I don't see another debate as ending in something productive.  I'll
> just leave it with this piece of advice: any API that intends to be as
> user-friendly as possible and desires to see extensive automation built on
> top of it needs to provide classes with parameterless (default)
> constructors....period.  Otherwise, dynamically creating instances via
> ClassLoaders cannot be done.
>

Here's the problem: The platform APIs that SWT is built on, require a parent when widgets are created (er....period). There were two choices, either mirror this in the API, or duplicate every bit of state the widget maintains so that the widget could exist in an un-parented state (state stored locally) or a parented state (state stored in the OS). Even assuming that this could have been implemented without consistancy problems (and I have never seen evidence that *any* system that attempted to do this was 100% successful) it would have meant significant overhead in *every* widget API as the code checked which state it was in and handled the situations differently.

In addition, zero argument constructors are not a requirement for building automation. There has been extensive discussion of this in the SWT mailing list in the past. Both GUI builders, and "robots" can be/are being built on top of SWT in its current form. If you would like to turn the discussion to how this might be achieved, you're much more likely to get a constructive discussion going here.

McQ.

Back to the top