In this chapter we've discussed the importance and benefits of a strong generic infrastructure backing app implementation. While aJ2EE app server provides powerful standard infrastructure forJ2EE apps, we need to use additional infrastructure components to make the J2EE APIs easier to use, ensure that app code focuses on addressing business problems, and solve problems that the J2EE specifications do not. To illustrate these points, and to provide a potential basis for your own apps, we've examined some of the key infrastructure packages used by the sample app, and the problems they exist to solve. We've considered the importance of infrastructure that enables central configuration management. We've seen how making app components JavaBeans can allow them to be configured by a generic app framework, removing the need for app code to implement configuration management such as property file lookups. In combination with interface-based design — in which code is always written to interfaces, rather than classes — the use of JavaBeans is an incredibly powerful means of assembling and parameterizing apps without modifyingJava code. Once configuration management is centralized, it is possible to read configuration from any source — such as XML documents, properties files, or JNDI - twithout any need to change app code. Configuration viaJavaBean properties ensures consistency across apps and between architectural tiers. For example, EJBs can use the same approach to configuration management as ordinary Java classes. We've looked at several layers of infrastructure that enable us to achieve central configuration management:

The standard J2EE infrastructure makes some simple things difficult, which has caused widespread frustration with J2EE in practice. This can be addressed by a simplifying infrastructure that makes J2EE APIs and services easier to work with. We've seen how infrastructure can be used to simplify working with complex J2EE APIs, including:

Whether or not you choose to use the specific infrastructure described in this chapter, all these issues should be addressed outside app code, which should concentrate on the problem domain and implementing business logic.

Finally, we looked at some of the core implementation of the sample app, illustrating how it is simplified through use of appropriate infrastructure.