3.3. MVC Architecture

The Model-View-Controller (MVC) architecture is one of the most widely used designs in object-oriented software development. Within Java, we can see MVC used at many levels, including:

  • JFC components

  • The interaction of servlets and JavaServer Pages

  • The Apache Struts framework

The “model” encapsulates the application's state and contains the business logic. For our application, we've created the package nfl.application to represent the model. (The nfl.persistence package provides persistent storage for the data in our model, but doesn't really play into the MVC interactions described here.) The model should not have any dependence on how the information will be displayed to the user; for example, by the end of this chapter, ...

Get J2EE™ and JAX™: Developing Web Applications and Web Services 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.