Skip to main content

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

On Thu, 8 Jan 2004, Steve Northover wrote:

> To really answer this question, you need to describe the cases that 
make 
> sense to you.

for instance, I want to ensure that all my windows get the same 
application icon, so I make a base class, that derives from Shell and
sets the image in the constructor.
From a OO design point of view, there is nothing wrong with that.
The subclass clearly has a is-a relationship with Shell and since I 
don't want to make any more assumptions about the derived classes, a 
wrapper class would be not good, essentially instead of inheriting the 
whole Shell API, I would have to wrap a huge amount of functions.

> The technical reaons are that the Shell class was not 
> designed to be subclassed and is different on different platforms.

the implementation of Shell is different on different platforms, but not 
the API. And the implementation (whether it uses Java or JNI) is 
encapsulated in a class.
with technical reasons I mean any other reasons than whether it is good 
or bad software design. Is it a bug if I create a sublass of Shell?
How could something break or be platform-dependent?

Thanks

- Markus



Back to the top