Читать книгу Beginning Spring - Höller Jürgen - Страница 13

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

Оглавление

In this chapter, you first learned the problems of the old-school EJB programming model that caused many enterprise Java projects to fail completely – or at least fail to satisfy their promises to some degree. The main problems of the old EJB programming model was that developers had to write several interfaces to create a business component, tight coupling between EJB and J2EE technologies was necessary, you couldn't run components outside the J2EE platform, there was difficulty in unit testing outside the container, long and complex develop-package-deploy-test cycles were required, and the characteristics and limitations of J2EE technologies required promotion of the procedural style of programming. Then you found out how those problems led to the creation of the POJO programming model, how the POJO programming model solves the problems of the EJB programming model, and how the POJO programming model helped J2EE to evolve into the new Java EE environment.

This chapter discussed why so many people insisted on using J2EE technologies and tried to deploy their enterprise applications despite all those obstacles in the J2EE environment. After identifying the attractive points of the J2EE platform, we defined what a container is, listed fundamental features a container should offer to its applications, and identified what makes a container lightweight by looking at its characteristics.

The last part of the chapter focused on what IoC is, and what any container should offer as its core services. We discussed how IoC helps make applications more modular and pluggable. The chapter wrapped up with an explanation of dependency injection, which is a form of IoC, and its two different types: setter injection and constructor injection.

EXERCISES

You can find possible solutions to the following exercises in Appendix A.

1. Investigate the in-container test frameworks available today. What are their biggest advantages and disadvantages compared to testing outside the container?

2. What IoC method is used by the new EJB programming model today?

3. Which dependency injection method can handle “circular dependencies” and which cannot?

WHAT YOU LEARNED IN THIS CHAPTER


Beginning Spring

Подняться наверх