A component may not always provide a complete implementation. In some cases, fragments
may be used to complete or extend a component.
For example, the primary component may provide an implementation that contains translatable text in a default language. Fragments are then used to provide translations for additional languages.
A second case where fragments are often used is to provide platform (processor/operating system) specific implementations.
Fragments contain either a fragment.xml
(similar to a plugin.xml
), or a MANIFEST.MF
, or both. A fragment is associated with, or dependent upon, a specific primary component, but still maintains a unique identity. Querying a list of components will also return fragments, so that these fragments can be individually started and stopped.
Fragments generally add classes or resources to the class path normally used by the primary component. Fragments do not contain Bundle-Activator
classes. Since fragments are only extensions to a component, they cannot be required or imported by another component.
Parent topic: Packaging