An IDE is more than a collection of its component parts, and the Eclipse 4 framework allows these to coordinate and communicate with each other.
In prior releases of Eclipse, the Platform
(or PlatformUI
) object would act as an oracle of the known services in the runtime infrastructure, as well as providing hooks for accessing those services, for example:
IExtensionRegistry registry = Platform.getExtensionRegistry(); IWorkbench workbench = PlatformUI.getWorkbench();
Although this provides a programmatic way of making the services available, it has two key disadvantages:
The goal of E4 is to decouple service providers and service consumers through the use of OSGi services
. These are contributed to the runtime, and can be looked up via interface name using either standard OSGi mechanisms, or through E4 injection. Although that is the general trend, some platform services accessed by the IServiceLocator
aren't backed by OSGi services.