Designing Data-Intensive Web Applications

In the previous chapter, we discussed how to implement WebML hypertexts, by translating WebML pages and operations into JSP templates. Any WebML specification, even complex pages accessed in multiple ways, can be implemented by following the guidelines and examples of code presented in Chapter 12. However, the resulting programming style is based on "all-inclusive" templates, intermixing the business logic, the data access code, and the presentation, which impairs application maintenance and code reuse.
Improving the quality of the implementation requires the adoption of a more modular software architecture enforcing the principle of separation of concerns. The monolithic page templates of Chapter 12 should be broken down into smaller components, and each component should address only one specific aspect, for example data access, business logic, or presentation, so that each aspect could be modified separately, with great benefits on maintenance and evolution.
To this end, the examples of this chapter adopt a software architecture called Model-View-Controller (MVC), expressly conceived for improving the separation of concerns and modularity of software applications. With this reorganization, the page and operation templates of Chapter 12 are partitioned into reusable components, which are easier to produce and maintain.
In addition to the revision of the software architecture according to the MVC design pattern, we also explain other advanced techniques suited to very large applications: the definition of generic unit and operation services using XML descriptors, the development of distributed business objects with the Enterprise JavaBeans standard, and the centralized management of presentation...