three-tier is synonymous with n-tier or multi-tier
Application code in a client application would be considered to be part of the Presentation tier. Code that creates HTML for a web browser is also part of the Presentaion tier. A Web container/server that produces HTML for a browser is part of the Presentation tier.
The code of the browser (Explorer or Netscape) which resides on client computers is not part of the application. [ April 21, 2008: Message edited by: James Clark ]
>You elaborated on presentation layer. That was good.
Thanks. To be concise, my elaboration was about the Presentation tier. I never called it a "layer." I never use the term layer in practice.
There is a difference between what a "tier" is and the physical location of a group of nodes. Tier in the Java EE Reference Architecture is a design concept. The term "three-tier" translates into Presentation, Business and Integration tiers. There are three of them. There can be hundreds of nodes. The design is still referred to as three-tier. Some individuals use the term multi-tier.
Since I don't use the term layer I can't speak on it.
-- Presentation -- Business -- Integration --
You might consider that on the Business tier, there are layers. There may be a business logic layer and a data access layer in the Business tier.
You might consider that on the Presentation tier, there are many layers. There may be a presentation data model, Swing GUI, Java Server Pages, UI components, WAP servlets, etc.
The Integration tier also may have layers. The might be enterprise legacy systems written in COBOL, relational databases, file systems, Web services, etc. There may be a layer of JCA adapters that enable communication between the Business tier and EIS applications.
Hope this helps. [ April 21, 2008: Message edited by: James Clark ]
As for Tier and Layer, I read some time ago that layer refers to logical partitioning as tier refers to physical. So if you have each layer on one server, you can call them tiers. From then, I use this convention and I know it is popular. But your description makes sense too, and I know except in rare cases it is compatible with this convention.
So let me go back to my example. I call all those terms layers. OK? so I have Presentation layer -- Application Logic layer -- Data Access layer -- Database layer
If I am right, you mean that Data Access layer and Database layer here, are parts of Integration tier in your terminology. Am I right? similarly Application Logic layer falls into Business tier and Client and Presentation layer, build Presentation Tier.
So we won't have 4 tier at all? will we?
Also, if I have a JSP talking directly through JDBC to database, in SQL language, is it still three tier? I would say no, but look at for example Sang Shin's online course, J2EEOverview_speakernoted.pdf, page 21 http://www.javapassion.com/j2ee/J2EEOverview_speakernoted.pdf it implies such a thing is still three tier.
Also what do you answer to the question of advantage and disadvantages of multi-tier over three tier?
Thank you Ulf. Hope you and other people participate. I think if we accept James explanation, Tier refers to concepts. What is the function of all these THINGS, presentation ? So they are part of Presentation Tier. Establishing the business logic? So we can call them a Buiness Tier, accessing to database, etc, so they are part of Integration Tier... No matter they are on one node, or billions, clustered, ... .
(Microsoft uses layer more frequently if I am right. Oracle has its own terminology. for example look at MVC and ADF model. Do you agree that model-view-controller for example in ADF all fall in Presentation Tier?, ok let's keep it simpler, forget the text in the bracket)
The Internet today allows individuals and organizations to publish information with very little governance and regulations. It is getting easier and easier to put stuff on an Internet web page. However, not all technical information that is on Internet web pages is accurate. I am not an expert, but I have seen very fancy, nicely done web pages about software development that contains incorrect information. There is no way to prevent this, so the best strategy is to favor published printed material that has been professionally edited and is published by a reputable publishing company, e.g. Addison Wesley, O'Reilly, McGraw Hill
The three-tier model that I describe above is from the Java EE Reference Architecture created by Sun Microsystems(see ref below).
The data access objects (layer) are/is part of the Integration tier. The business objects communicate with the data access objects to send and receive data from the Integration tier.
> So we won't have 4 tier at all? will we?
There is no fourth tier. There is a Presentation, Business, Integration tier.
> Also, if I have a JSP talking directly through JDBC to database, in SQL language, is it still three tier?
No. This design is not in accord with the three-tier programming model from the Java EE Reference Architecture.
> Also what do you answer to the question of advantage and disadvantages of multi-tier over three tier?
* Sun Certified Enterprise Architecture for J2EE Technology Study Guide (Sun Microsystems Press) ISBN-10: 0130449164 [ April 22, 2008: Message edited by: James Clark ]
hello folks Tier and layer are similar concepts in the real life, but different in j2ee world. Every application is a set of "roles" that some components have to play. There is a gui or a browser that wants to connect with your application. There are pages to show your data and the controller that accept your request. There's the core of the application that knows how execute your order, the business logic there are components that speak with the db finally there's the db
Now imagine Tier like "role" that some component of your application play.
the client tier (gui applications, browser, and so on) presentation tier (jsp, servlet, business delegate) business tier (session bean, entity bean, business objects) Integration tier (Data Access Object, jdbc, j2ee connector, and so on) Resource tier, or Resource tier (DB, legacy systems)
if you have one jsp that execute a query and shows the result (it's an oscar actor) then that page is playing presentation,business and integration role, but a serious film have different actors
Layer is a part of a subsystem that encapsulates an exact functional (business) responsibility and that collaborates with other next layers. A layer is about business, tier is about architecture
GiUsEpPe (SCJP, SCWCD, SCBCD, IBM OOAD, SCEA/OCMJEA 5)
For me, layers always are from the logical system point of view and tiers are form the physical point of view. In UML, layers will visible be in the logical view and tiers in the deployment view. The JEE 5 tutorial reference doesn't seem to help, because it maps the web and business tier into the JEE app server and states that form only one tier...
In that particular case, if you have the web tier in a separate server (or servers), you effectively have a 4 tier application.
Thank you all. I still look forward to any comments. James answer was consistent but I think we should be wary of other conventions.
As Gabriel said, I think Java EE Tutorial is sitting on the fence also however it calls all of them 'tiers', especially EIS tier. It says: Although a Java EE application can consist of the three or four tiers shown in Figure 1-1, Java EE multitiered applications are generally considered to be three-tiered applications because they are distributed over three locations. (http://java.sun.com/javaee/5/docs/tutorial/doc/bnaay.html) I personally don't like this ambiguity. It makes mention of physical LOCATION, which is a bit irrelevant. My impression is that they favour four tiers idea.
I liked giuseppe's explanation, but thinking of a jsp having many tiers INSIDE, in fact, is a bit scary!
All were helpful although I think there is no strict convention here.
I don't think physical location (i.e., servers) figures into this, at least not in the commonly used definitions for these terms. It doesn't make sense to call something an n-tier vs. an (n+1)-tier architecture depending on whether the web server and the app server run on the same machine. [ April 23, 2008: Message edited by: Ulf Dittmer ]
In fact: 'tier' in not 'phisical' If you have web-server, application server, and database in the same machine you have in any case 4 tier (presentation, business, integration and EIS), but "all in one phisical location"
GiUsEpPe (SCJP, SCWCD, SCBCD, IBM OOAD, SCEA/OCMJEA 5)