Chapter 8. Developing Web Applications Using the Model 2 Architecture

In the previous chapter, you learned about building web applications using the Model 1 Architecture, which is heavily dependent on a page-centric development focus. In this chapter, you review and apply a prominent pattern in software development known as Model-View-Controller (MVC) to build web applications in a more modular and componentized manner. You learn a little about the Model 2 Architecture, particularly a framework known as WebWork, and its use of a concept known as Inversion of Control. You will see an example of how componentized development with WebWork provides a tremendous advantage to you as a web developer, as it saves you time in having to rebuild the same components over and over in your application.

The Problem

Imagine your office needed a centralized contact manager for referencing people that could be used for given projects. You know that such functionality would be useful, but are worried about trying to do something too ad hoc and inflexible, leading to it being quickly thrown away.

You need something quick, but flexible. You need something where you can reuse a lot of components to build your solution. You need to look at a Model 2 Architecture framework.

What Is Model 2?

To understand Model 2, you should review the Model-View-Controller paradigm, which you examined in depth in Chapter 3. As you saw in Chapter 3, MVC is often described in the context of Swing, so you may be wondering, "But ...

Get Professional Java® JDK®, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.