DEV Community

Orestis Pantazos
Orestis Pantazos

Posted on

⚓ Design pattern for web applications (MVC) based in JSF framework

The most popular design pattern for web applications is MVC (model-view-controller) design pattern in JSF that stands for JavaServer Faces. It could be described MVC in several applications such as desktop or web applications.

More specifically in JSF paradigm, the mapping is as follows:

Model - The services or DAOs (Data Access Objects) in addition with the entities that they produce or consume something into the web application. The entry point to this option is the managed bean (e.g. or, but in Java EE (Java Enterprise Edition) that JSF is part of it nowadays, these artifacts are typically implemented by EJB (Enterprise Java Beans and JPA (Java Persistence API) respectively.

View - The user interface (UI) components such as PrimeFaces UI components and their composition into a full page. This is fully in the domain of JSF and implemented by JSF UI-Components and Facelets respectively. There are several libraries for user interface such as PrimeFaces, OmniFaces, MyFaces or ICEFaces. In comparison with JSF framwork, there is also ADF (Application Development Framework) from Oracle.

Controller - The traffic transactions that handles commands and incoming data from the user, routes this to the right parts and selects a view for display. In JSF one doesn't write this controller, but it's already provided by the framework (FacesServlet).

Alt Text

🔁 To Be Continued 🔁

Top comments (0)