When you define a definition for an element, you specify how to create
the element and define the dependency to other elements. In fact, the definition
is a template from which to create an element, you can create multiple instances
of element from the definition.
The attribute
Scope specifies
how many instances of element you can create from the definition. The ElementFactory
supports two scopes:
Table 1. Supported scopesScope |
Description |
singleton |
There is only one instance for the element definition
in one ElementFactory. |
prototype |
The element instance is created every time on the invocation
of getelement(String id). |
Note: It is not required to define attribute
Scope in
every element definition. There is a default
Scope value
singleton.
To change the default scope of the element, see
Customizing ElementFactory for
more detail.