Using MVC in Designing Web Applications

A good strategy when designing your enterprise application is to have separate layers, each of which is unaffected by changes done on the other layers. The Model-View-Controller is a design pattern that is used to partition your Web applications into the following components (see Figure 7.8):

  • Model: A set of objects that represent the business logic of the application. This usually includes EJBs, JavaBeans, and other abstractions of real world entities.

  • View: Represented by JSPs as the user interface, which is necessary to construct the presentation. You can have multiple views for the same model.

  • Controller: Represented by servlets, which contain the necessary logic to process user events, manage screen ...

Get Sams Teach Yourself EJB in 21 Days 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.