• Post Reply Bookmark Topic Watch Topic
  • New Topic

Usefulness of EJB

 
vishal sodani
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I keep reding article after article,which indicate that EJB uses lot of resources,and after all it is not such a great technology.We can do without it.Any opinions?
vishal
 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've heard it said that EJBs and maybe even regular JavaBeans were Sun's attempt to be a Java form of ActiveX. However, they are useful in their own right, as they componentise logic. That's very important in software engineering, where the often-sought/seldom-realized goal is to have plug-in, well-documented, well-defined, pre-debugged technology.
EJBs can be a lot of overhead, especially when used unintelligently. However with a large complex system where processing may be distributed and transaction intergrity may be critical, they begin to prove their worth, since these high-overhead features are presupplied with EJBs - there's no need to invent and debug your own.
You can, and often should, avoid EJBs for small projects or special performance situations where nothing but a custom solution will do, but there is definitely a place in the toolbox for them.
 
James Hobson
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJBs offer enterprise services, in simple terms, if you need these services then EJB (particularly CMP) is an almost trivial way of getting transactioning etc.
Using EJB is also a goos way to enforce (well, it helps push you in the right direction) sensible encapsulation.
If you do everthing with prepared statements etc it is very easy to have a highly coupled system, EJB encourages you to encapsulate.
In that sense EJB is a winner, although design patterns such as Data Access Objects give you the same thing.
 
Matjaz Juric
Author
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJBs are currently the most advanced technology for building middle tier business logic components. Never before was it so easy to develop portable reusable components that provided transactional support, security, persistence management and resource management. Even better, EJB provides these services in a declarative way, meaning that we do not have to write code to use them.
EJB is also the only component architecture that supports components with state. Combining state and behavior is namely the primary OO directive.
EJB is targeted to enterprise information systems. With support for all this functionality it definitely requires resources, but this doesn't make it a bad technology. BTW, a powerful engine also needs more fuel to operate.
Cheers,
Matjaz

------------------
Matjaz Juric
Author of Professional EJB
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!