Pankaj Kumarkk wrote:
Pedro Kowalski wrote:You can use EJBs in the same JVM as presentation layer, but you can also spread it across different JVM's. It's just one of the architectural decisions you have to make.
Yes I can do that. My question is "Why I would like to have such deployment architecture". I do not see any benefits due to such deployment structure. Please comment.
Uhm, I'm a bit confused what would you like to know. What are the benefits of business and presentation living on the same tier or what are the benefits of business and presentation living in separate tiers?
I do not think deploying business logic(thru EJBs) on a separate machine buys me any benefits)
Well, I think you answered yourself :-) If your architecture doesn't need to use any remote objects and it's not spread across multiple JVM's (i.e. for clustering purposes) than there is no need to spread business logic layer and presentation layer across different tiers. Both layers can reside in one tier and use only local access.
Sometimes you need to serve remote clients (i.e. fat client, legacy software, etc.). In this case your presentation layer and business logic are on separate tiers. Then you'll need remote interfaces.
At the end - just remember that if you use EJB it doesn't mean that you need to separate layers between tiers. Just like using Spring doesn't mean that all layers resides on the same tier. You can use both approaches on either EJB or Spring.
Hope that helps.
Cheers!