Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Question about Java EE 6 architecture

alt text

  1. From the picture above, I would conclude that Java EE 6 architecture is an 3 tier architecture. What I dont understand is what exactly is the client tier? Isn't the UI code suppose to be the client tier. JSF handle the UI of the application, shouldn't JSF be at the client tier?

  2. Java EE 6 utilizes 3-tiers architecture, and JSF is an MVC model, can somebody tell me what I am about to say is correct or not? 3-Tiers architecture is a linear model, where client input cant go directly to the data tier. Everything must go through the middle tier. Then we have JSF is a MVC model. Well we all know the controller is the FacesServlet, the view is the Page itself. What is the Model?

a. It cant be the database itself, since 3-tiers said that everything must go through the middle tier. Is the Model is the managed bean, served as a gate way to the database?

OR

b. since JSF is already in the middle tier, therefore the Model is in fact the database.

like image 339
Thang Pham Avatar asked Nov 16 '10 15:11

Thang Pham


2 Answers

The client tier is everything which runs in the client machine. In case of a (Java EE) web application, that's usually the webbrowser. All it runs is HTML/CSS/JS and it communicates with the server side by HTTP. The UI code (the JSF code) is covered by the web tier in the picture. It generates and sends HTML/CSS/JS to the client side.

Actually, the whole JSF thing fits fully in the web tier. The JSF part in the web tier can itself be divided further in model (managed beans), view (JSP/Facelets pages) and controller (FacesServlet). The business tier covers the EJB's. Then there are persistence entities (also called data transfer objects) which can go through all the tiers from the database through business to web and back.

like image 110
BalusC Avatar answered Nov 05 '22 04:11

BalusC


In addition of what M. @BalusC well explained, here's a nice schema that illustrates (first question) the position of JSF inside the Presentation tier (which includes client side):

JavaEE Architecture with EJB and JSF

Where the two rectangles in the left, represent the presentation tier, and the two rectangles in the right are for business tier. While the dotted wide rectangle represents the Java EE application server that includes both the web and EJB containers.

like image 1
Omar Avatar answered Nov 05 '22 05:11

Omar