14 Model View Controller Pattern


  • An introduction to the MVC pattern
  • The MVC pattern’s origins
  • How to implement the MVC pattern using compound patterns
  • Implementing the MVC pattern In Java EE
  • When and where to use the MVC pattern


The wrox.com code download for this chapter is found at www.wrox.com/go/projavaeedesignpatterns on the Download Code tab. The code is in the Chapter 14 download and individually named according to the names throughout the chapter.

The model view controller (MVC) pattern is one of the most ubiquitous architectural design patterns in modern application development that is listed in the book from the Gang of Four. It is built on the philosophy of separation of concerns and encapsulates the processing of application data from the presentation of the data. Not encapsulating the processing of data from the presentation of data leads to highly coupled systems that are hard to maintain and extend. The separation of concerns that the MVC pattern provides makes modifications to both the business logic and the user interface much easier and more independent.

The MVC pattern is not much different than buying a subscription from a cable provider and a TV set from an electrical store. One provides the content, and the other makes sure you view it in the right way. Neither worries about the changes in the technology on the field. You can always buy a new TV set when better panels are ...

Get Professional Java EE Design Patterns 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.