<extension
point="org.eclipse.core.component.types">
<component
initializer="org.eclipse.ui.part.SiteInitializer"
interface="org.eclipse.ui.part.services.INameable"
implementation="org.eclipse.ui.internal.part.services.NullNameableService"
singleton="true"
/>
</extension>
The initializer attribute indicates
where the interface will be used. For example, the string "org.eclipse.ui.part.SiteInitializer"
means that the interface is used on a part's site. We could have also used "org.eclipse.ui.part.PartInitializer"
if the interface was intended for parts themselves to implement.
The interface attribute is the name
of the interface. This must exactly match the type that the component will receive
in its constructor. If we create an extension that supplies Strings and a component
asks for an Object, it will not use our extension even though it would have
been a compatible type.
The implementation attribute identifies
the default implementation of the interface. It either points to a component
class that implements the interface or a ComponentFactory that can create them,
for additional information, see the ComponentFactory section . This implementation
is used to satisfy a dependency whenever a component requests this interface
and it can't be found in its parent context. All interfaces must supply a default
implementation. This means that a correctly written component will always work
in a given scope, regardless of how many dependencies are supplied by its parent
context. The implementation cannot override or extend the interface attribute
by implementing additional interfaces. Other components can depend on this component
through its registered interface, but cannot depend on the implementation class
directly.
The singleton attribute indicates whether
the default implementation is a singleton. If true, then a single instance will
be created and shared between every other component that needs it. If false,
then a new instance will be created for each container that needs it. For example,
in the case of parts, singleton=:"false" would mean that one instance will be
created for every part.