Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

When are EJBs inappropriate?  RSS feed

 
Junilu Lacar
Sheriff
Posts: 10878
158
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the question needs to be in a separate thread so I have copied some of the posts from the weekly giveaway announcement thread below:

Originally posted by Tom Ben:
Welcome Subrahmanyam Allamaraju!
What is your take on EJB? I am looking to move our paltform from SE to EE and want to get some opions on this.


Originally posted by Scott Ramsey:
What are some of the scenarios in which using EJBs inappropriate, from both a technical and a business perspective? Without a doubt using EJBs requires specialized tools and specialized knowledge, both of which can be expensive and introduce risk to a project. To phrase it differently, what technical and business factors justify the expense & effort?
I have found some discussion of this issue elsewhere, but would very much like to have your thoughts. (If it help you structure a response, here is a little background on me: I come from a business background, have an MBA, and am now spending some time getting my hands dirty in the technology in order to understand it better.)


Originally posted by JUNILU LACAR:
I just read an editorial piece in the December 2001 "Java Solutions" this morning written by Allen Holub. I would be interested in hearing what you all think about what he wrote.


Originally posted by Tom Ben:
That is a really good article. It is so true in today's field. People just want the end result and care nothing for how it gets done (which is very sloopy)!


More comments?
 
Allan Moster
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is one article by Kyle Brown I still find very useful:
http://www-106.ibm.com/developerworks/library/ibm-ejb/
 
Subrahmanyam Allamaraju
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my take on EJB.
[I'm not an evangelist, and these are just my opinions.]
I would use an EJB under the following conditions:
(a) Coarse-grained (with no in-memory state) application logic. By this I exclude beans with fine set/get methods and methods requiring lots of client-server traffic. Typical coarse-grained systems implement large chunks use cases.
(b) Container-managed transactions. Yes, for those of us who have not programmed distributed transactions before MTS and J2EE, this is a major benefit.
(c) Container-managed security. Yes, provided you design the rest of the system with security awareness.
These conditions require a very pragmatic assessment.
Having said this, I would not do the following:
(a) Container-managed persistence: CMP can not capture the complexity of persistence in coarse-grained beans. Every now and then, we find some news of some "better" managed persistence (whether CMP or JDO or some such thing). I think these attempts consider very simple data models, and leave us programmers to face more complex data models and persistence needs.
(b) EJBs for the sake of having a "middle" layer: I don't buy this argument. There are cheaper ways of separating logic - and separating logic via a remotable layer is not among them. One example is the recent debate between .NET Petstore and J2EE Petstore. Most of the arguments I heard for J2EE talk about portability, layering, patterns and so on. I think that these are most academic arguments.
What do you folks think?
Subbu
------------------
Subrahmanyam Allamaraju
Author of Professional Java Server Programming J2EE 1.3 Edition
 
Kartik Shah
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this article
http://www.theserverside.com/resources/article.jsp?l=Is-EJB-Appropriate

 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Subbu,
Is it still true for EJB 2.0: CMP can not capture the complexity of persistence in coarse-grained beans ? or Any improvement ? to what extend ?
Thanks
Ruilin
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!