aspose file tools*
The moose likes Associate Certification (SCJA,OCAJ 5/6) and the fly likes In which tier should  servlets be ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Associate Certification (SCJA,OCAJ 5/6)
Bookmark "In which tier should  servlets be ?" Watch "In which tier should  servlets be ?" New topic
Author

In which tier should servlets be ?

Eusebio Floriano
Ranch Hand

Joined: Mar 07, 2004
Posts: 237
I mean, according with SUN�s blueprint, Servlets should always be in view tier
or if it may be in business tier also ?
I think it is very subjective, don�t you ?

Regards,


SCJP 1.4 / 5.0 - SCBCD 1.3 - SCWCD 1.4 - IBM 484
Mahesh Kumaraguru
Ranch Hand

Joined: Jun 01, 2005
Posts: 95
Servlets and JSPs are in web tier with Servlet as controllar and JSP as view, EJBs are in business tier.


Regards,<br />K. Mahesh<br /> <br />SCJP 1.2 Aug-2001 : 79%
Bilal Sallakh
Ranch Hand

Joined: Feb 26, 2005
Posts: 45
Some references classify Servlet as the controller in MVC and therefore consider it in Business tier. Other references classifies it as View (its responsibility should be concerned only with views while the Controllers do Business Logic) so it lies in the web tier.

One wants to know what the exam authors consider it


SCJP for J2SE 5.0 (beta)<br />SCJA (beta)
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
Basically, Servlets and JSP are components in Web Tier, whereas EJB is components in Business Tier.

The questions in the exam will be very clear so that you know what you have to choose.

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Eusebio Floriano
Ranch Hand

Joined: Mar 07, 2004
Posts: 237
Originally posted by Nicholas Cheung:
Basically, Servlets and JSP are components in Web Tier, whereas EJB is components in Business Tier.

The questions in the exam will be very clear so that you know what you have to choose.

Nick


But when we�re talking about web-based apps with no EJB. A servlet could be the controller, couldn�t it ? Or even in a web-based app should i consider Servlets for view�s purpose only ?

Like i said, i just think that this is very subjective.

Regards,
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Vinicius Boson:


But when we�re talking about web-based apps with no EJB. A servlet could be the controller, couldn�t it ? Or even in a web-based app should i consider Servlets for view�s purpose only ?

Like i said, i just think that this is very subjective.

Regards,


As someone has just mentioned above, Servlet is responsible for the controller role in MVC model, but that so-called controller is still in presentation(web) tier...


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Mahesh Kumaraguru
Ranch Hand

Joined: Jun 01, 2005
Posts: 95
From Designing Enterprise Applications with the J2EE(TM) Platform, Second Edition :-
1.2.1.1 Multitier Model
The J2EE architecture defines a client tier, a middle tier (consisting of one or more subtiers), and a back-end tier. The client tier supports a variety of client types, both outside and inside of corporate firewalls. The middle tier supports client services through Web containers in the Web tier and supports business logic component services through Enterprise JavaBeanstm (EJBtm) containers in the EJB tier. On the back end, the enterprise information systems in the EIS tier are accessible by way of standard APIs.

Also refer 4.4.2 Web-Tier MVC Controller Design
[ July 06, 2005: Message edited by: Mahesh Kumaraguru ]
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
I would say, arguments are correct here.

However, when you sit in the SCJA exam, there will be obvious choices that you will definitely select them.

Moreover, SCJA is too preliminary that it does not care too much about the detail.

Nick
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982

But when we�re talking about web-based apps with no EJB. A servlet could be the controller, couldn�t it ? Or even in a web-based app should i consider Servlets for view�s purpose only ?

Like i said, i just think that this is very subjective.

I agree, even JSP can be business tier in such sense because we can always code business logic there, even connect to legacy systems.

Nick
Mahesh Kumaraguru
Ranch Hand

Joined: Jun 01, 2005
Posts: 95

I agree, even JSP can be business tier in such sense because we can always code business logic there, even connect to legacy systems.


If we do this then we are not talking about Model 2 / MVC architecture / N-Tier systems. Then it becomes like an old Cobol program where a single program displays an input screen, reads user input, validates it, does database I/O, displays output screen - Model, View & Controller in a single program.
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982

If we do this then we are not talking about Model 2 / MVC architecture / N-Tier systems

In fact, the questions do not specify what models or what patterns are using. Modelling & patterns are too details for SCJA. It just simply ask which technologies are used in xxx tier. Thus, normal assumption will be fine. Web tier is JSP & Servlets; Business tier is EJB.

Moreover, the SUN exams clearly show SUN's point of view. Web Components (SCWCD) are Servlets and JSPs while Business Components (SCBCD) are EJBs. Based on our discussions, Servlets can also be a business components but SCBCD does not include it.

When you take the exam and read the questions, you will find that no arguments for this issue.

Nick
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: In which tier should servlets be ?