Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Architecture question on the lack of IWorkbenchAdvisor and the use of final in some classes

Ed Burnette writes:
> I just noticed there is a WorkbenchAdvisor abstract class but no 
> IWorkbenchAdvisor interface, at least in M5. Was this deliberate
> or just an oversight?

Deliberate. API interfaces that clients are expected to implement are 
problematic if there is
a non-zero chance that additional methods might needed in future releases. 
We learned this
lesson the hard way :-( By using an abstract base API class instead, there 
is no loss of
generality and it is possible to add new non-abstract methods later 
without breaking binary
or contract compatibility.

> Compare that to WorkbenchConfigurer and IWorkbenchConfigurer. But... I 
just
> noticed WorkbenchConfigurer and some other new internal ui classes are
> declared "final" - isn't this also going against pattern?

IWorkbenchConfigurer is an API class that clients (specifically, the 
application's workbench configurer) are expected to call methods on, but 
not to implement. The internal implementation class WorkbenchConfigurer is 
marked final (it's the constructor is package-private, and the instance 
are secured) to ensure that the new workbench adviser facilities are 
available to the RCP application but not to regular plug-ins. The 
application has powerful global control over the workbench, and we don't 
want to tempt regular plug-ins into undermining the application's 
authority.

---jim


Back to the top