• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the difference between web tier and Buisiness tier?

 
Veena Pointi
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Web tier consists of components such as servlets,JSP and buisiness tier consists of components such as EJB's.From functional point of view what is the main difference between web tier and Buisiness tier?Don't servlets/jsp deal with buisiness logic of an application?If so why Servlets,JSP and EJB's can't be included in single tier which can be buisiness tier?I am sorry if this question sounds silly.I have just begun to understand J2EE technology.
Thanks
Veena
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The business and web tiers (or layers) are more of a logical separation instead physical separation. Therefore, is not really important what type of technology is used to implement each. What is important is that they are decoupled. For example, the business layer could consist of POJOs (Plain Old Java Objects) just as easily as it could consist of EJBs.
Regardless, of whether you choose to use EJBs, POJOs, or Web Services, there are definite advantages to separating (or decoupling) your web layer from your business layer. In general, it is consider "bad form" to have business logic in the web layer. There are obviously cases where it doesn't really pay off to go thru all this trouble (read: extremely small one-off applications) but in general this separation is highly recommended.
There are numerous OSS frameworks available to help us write properly layered web applications. I suggest you checkout the following: Struts, WebWork, and Spring.
[ January 17, 2004: Message edited by: Chris Mathews ]
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chris Mathews:
For example, the business layer could consist of POJOs (Plain Old Java Objects) just as easily as it could consist of EJBs.

Cheers Chris,
For expanding POJOs...Finally I understood what POJOs are!...Before, I thought they were some kind of alien web frameworks!
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One rationale for separation of business & presentation components is that you can use one set of business components behind several different views. For example, I'm working with an application server now that has a web server client, a fat java client and a SOAP client. If we happen to slip up and put business logic in one presentation layer, we may well have to duplicate it in all three. Bad news.
Here is a page I wrote up aboutarchitectural layering, and another about theDependency Inversion Principle that says the first one is sometimes backwards.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic