1 POJO Programming Model, Lightweight Containers, and Inversion of Control


  • Problems of the old EJB programming model that triggered the birth of POJO movement
  • Advantages of the POJO programming model
  • What a container is and what services it provides to its deployed applications
  • Lightweight containers and what makes a container lightweight
  • What Inversion of Control (IoC) means and its importance for applications
  • Relationship between IoC and dependency injection
  • Dependency injection methods, setter and constructor injection
  • Advantages and disadvantages of those different dependency injection methods

The Plain Old Java Object (POJO) movement started around the beginning of the 2000s and quickly became mainstream in the enterprise Java world. This quick popularity is certainly closely related with the open source movement during that time. Lots of projects appeared, and most of them helped the POJO programming model become mature over time. This chapter first closely examines how things were before the POJO programming model existed in the enterprise Java community and discusses the problems of the old Enterprise JavaBeans (EJB) programming model. It's important that you understand the characteristics of the POJO programming model and what it provides to developers.

The second half of the chapter focuses on containers and the inversion of control patterns that are at the heart of the lightweight containers we use today. You learn what a container ...

Get Beginning Spring now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.