Most programmers are familiar with the term "Service", and after the failure of Object Oriented Programming's promise to encapsulate all the behavior together with the object's state, programmers learned that the only way to deal with decoupling and re-use was to make the objects into data containers and deploy services that acted upon those data containers. Very much what functions did on structs back in the C and Pascal days.Qi4j will bring a lot of the behavior back to the Composite itself, but we still need Services for cross-composite functionality. The Qi4j Service model is fairly simple, yet powerful and flexible enough to accommodate most service-oriented patterns and ability to integrate well with external systems whether they are in-JVM or remote, such as Spring, OSGi, WS-*, Rest and others.
The characteristics of a ServiceComposite compared to other Composite meta types are;
- It is one singleton per declaration in bootstrap.
- It has an identity defined in bootstrap.
- It is Activatable, which is a kind of life cycle.
- It has an optional Configuration.