[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Re: Subclassing Shell

David Whiteman wrote:
You are definitely well versed in the pros and cons of subclassing vs.

And these pros and cons do not belong on this list. Whether SWT should be more "object-oriented" is a permathread and should be directed to the eclipse-platform newsgroup.

You are *probably* safe if you override an API method to do something
simple, and then call the superclass version of the method.  But it
was still not designed to guarantee safe subclassing.  The whole thing
is being aware of the risks involved, even if they are small.

With respect, the whole thing is that "not designed to be subclassed" means that subclassing is not supported. The names or arguments of protected methods may change in any future release or may the methods may go away entirely. They may be different on different platforms. Even if they stay the same, the semantics of the methods and/or the order in which they are invoked may change. There is no way to assess the risk of change.

Classes like this should be subclassed only to fix urgent bugs there is no other way to fix.

Bob Foster