Question about Java EE 6 Architecture

alt text

  • From the figure above, I would conclude that the Java EE 6 architecture is a three-tier architecture. I don’t understand what is the client level? Isn't the UI code a client tier? JSF handles the application user interface, should the JSF not be at the client level?

  • Java EE 6 uses a 3-tier architecture and JSF uses the MVC model, can someone tell me what I'm going to say correctly or not? 3-Tiers architecture is a linear model in which client input cannot go directly to the data layer. Everyone should go through the middle level. Then JSF is an MVC model. Well, we all know that the controller is a FacesServlet , the view is a Page . What is a model?

but. It cannot be the database itself, because 3-tier levels say that everything should go through the middle tier. Is the model a managed bean that served as a shutter in the database?

OR

b. since JSF is already in the middle tier, so the model is actually a database.

+7
java-ee design-patterns model-view-controller jsf n-tier
source share
2 answers

The client level is all that works on the client machine. In the case of a web application (Java EE), which is usually a web browser. All that it runs is HTML / CSS / JS, and it communicates with the server via HTTP. The UI code (JSF code) is covered by the web layer in the picture. It generates and sends HTML / CSS / JS to the client side.

Actually, the whole JSF thing fits completely into the web tier. The JSF part in the web tier itself can be further divided into a model (managed beans), a view (JSP / Facelets pages), and a controller ( FacesServlet ). The business layer covers EJB. Then there are sustainability objects (also called data transfer objects) that can go through all levels from the database through the business to the network and vice versa.

+6
source share

In addition to what M. @BalusC explained well, here is a good diagram that illustrates (first question) the position of the JSF inside the presentation layer (including the client side):

JavaEE Architecture with EJB and JSF

If two rectangles on the left represent the presentation layer, and two rectangles on the right represent the business layer. Although the dashed wide rectangle is a Java EE application server, which includes both websites and EJB containers.

+1
source share

All Articles