» POJC: the Plain Old Java Container
POJC: the Plain Old Java Container
The current trend in COP is to have components being POJOs or JavaBeans with no proprietary container API. But sometimes some components needs to access the container services and therefore become tied to the chosen container.
Now Java has for a very long time provided us with a container for JavaBeans: the little known java.beans.beancontext API. It provides many features we expect from a featured container: hierarchical containers, lookup and discovery services, and even notifications for hot deployment and disposal of services.
There's even a chapter on that subject in the invaluable Java Tutorial (which I used to learn Java years ago).
Each container could provide an implementation of this API, allowing component writers to use container-related services when needed while still being independent of any container-specific API.
BeanContext, the Plain Old Java Container. And let's use the good old BeanBox to draw our systems!