A lifestyle is a term that reflects a component implementation approach. Four basic lifestyle strategies are included in the Assembly API - these include the singleton, per-thread, pooled, and transient strategies. More information about these strategies is included in the following table:
Overview of the standard lifestyle strategies.
Strategy
|
Description
|
Available Services
|
singleton
|
A single instance of the component type will be shared by all consumers.
|
SingletonLifestyleHandler
|
thread
|
A new instance of the component will be created relative to each distinct thread.
|
ThreadLocalLifestyleHandler
|
pool
|
A container shall maintain a pool of components.
|
PooledLifestyleHandler
|
transient
|
New instance of the component are created on a per request basis.
|
TransientLifestyleHandler
|