Software
MVC architecture in a J2EE application
BlogZin
2006. 9. 26. 02:33
You need a solution that lets you develop loosely-coupled applications. The Model-View-Controller (MVC) architecture is the suggested solution. MVC has been used very effectively in GUI-type applications. By applying the MVC architecture to a J2EE application, you can separate the data access logic from the data presentation logic. You can also build a flexible and easily extensible controller that controls the whole flow of the application. The figure below depicts the MVC architecture.

The MVC architecture can be mapped to multi-tiered enterprise J2EE applications as follows:
- All enterprise data and the business logic to process the data can be represented in the MODEL.
- The VIEW can access the data through the model and decide on how to present them to the client. The VIEW must ensure that the presentation changes as and when the MODEL changes.
- The CONTROLLER can interact with the view and convert the client actions into actions that are understood and performed by the MODEL. The CONTROLLER also decides on the next view to be presented depending on the last client action and results of the corresponding MODEL action(s).
from Design Patterns for Building Flexible and Maintainable J2EE Applications