Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[e4-dev] Re: CSS relationship to e4 workbench

Kevin McGuire schrieb:
> 1) The use of optional dependencies is cool, but makes writing more code
> here tricky since it must be reflective which is brutal to write (I
> believe Boris has a "reflectify" refactor but that only helps the first
> time and change/debug is still a challenge).  It also is a potential
> point of introducing errors if we forget to add the CSS plugins to the
> product since the tooling won't warn you of their absence (being optional).

The trick is to only use reflection to verify that an optional
dependency is satisfied. Thereafter it's totally fine to call out to a
different class which uses the API provided by the optional dependencies
directly.

An example of this can be found in the Equinox Preferences bundle.
org.eclipse.core.internal.preferences.Activator#start
org.eclipse.core.internal.preferences.Activator#addingService

OSGi services actually do support this very well because you only need
to reference the service class by name.

-Gunnar

-- 
Gunnar Wagenknecht
gunnar@xxxxxxxxxxxxxxx
http://wagenknecht.org/



Back to the top