Where We've Been
Applications built today without the services of Enterprise JavaBeans require quite a bit of overhead code, particularly in the area of transaction management and SQL execution. The open-source container used in the Remulak example is the Apache Tomcat product.
Servlets and JavaServer Pages working together are called the Model 2 approach to the MVC pattern. Servlets act as the first line of defense to the browser and route all the traffic. They play the role of user interface controller. The container knows to execute a given servlet via the web.xml descriptor. All container products, whether commercial or open source, use the web.xml descriptor.
The use-case control class has a one-to-one mapping to a use-case. Each pathway in the use-case will have an operation in the control class. The logic found in these individual operations maps to the sequence diagrams created during the dynamic modeling activities of the project.
To coordinate the transactional aspects of the use-case control classes, a TransactionContext class is used to manage the unit-of- work control. This object is passed through the entity beans and eventually into the DAO classes, giving them the ability to work on the same connection before a commit or rollback decision is made in the use-case controller.
Entity bean classes and DAO classes work hand in hand to insulate the outside world from the persistence mechanics of the system. There is a one-to-one mapping between entity classes and DAO classes. All DAO classes implement the same DataAccess interface.
Where We're Going Next
In the next chapter we:
Explore the second iteration of the architectural prototype using Enterprise JavaBeans.
Review how additional functionality is added to the Maintain Relationships use-case and how both roles and addresses are handled.
Discuss how both bean-managed persistence and container-managed persistence, along with container-managed transactions, alleviate the extra burden of controlling the unit-of-work activity of the use-case pathways.