DEV Community

Orestis Pantazos
Orestis Pantazos

Posted on

3 2

⚓ 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. UserBacking.java or UserMB.java), 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

https://www.opendevops.dev/design-pattern-for-web-applications-mvc-based-in-jsf-framework/

🔁 To Be Continued 🔁

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay