struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Radu Badita <>
Subject [OT] Re: [To sum it up] Re: Confused / one little question
Date Wed, 15 Jun 2005 14:49:25 GMT

In fact, this thread was really about Struts and how it integrates with 
various J2EE technologies and containers, not "about Hibernate/EJBs"...
Anyway: I don't think that anyone says that Hibernate is better than EJB 
period; but maybe easier and more flexible to use than Entity EJBs CMP, 
which is just one of the species of EJBs.
It is true that EJB (entity beans or not) has these nice features you 
mention: declarative transactions and declarative security (multi 
threading and "synchronization" are in fact container and coding 
related, and also "implemented" by Hibernate), BUT the question is: are 
those really necessary?
Hibernate also supports CMT, and, if facaded by SessionBeans (which is a 
very common scenario and is also recomanded for entity beans), you have 
declarative transactions.
Security is a very nice feature, but in scenarios where you only use a 
web application to access the EJBs, and the EJB container is "isolated" 
from the rest of the world, it becomes either useless, or a burdain to 
use... And I think that this scenario is the most common (especially 
among the subscribers to a list such as "Struts Users" :)
It's also true that in some scenarios the Entity Beans might be more 
effective than using an ORM such as Hibernate, but these scenarios are 
extremely rare...
Also, even Hibernate is sometimes regarded as being too complicated and 
too hard to learn by some (it was a very hot discussion about this on 
this list), and in even simpler scenarios are preferred even simpler 
tools such as iBatis, ORB, etc..
In my opinion, a discussion with a subject such as "EJB is better than 
Hibernate" is completely meaningless... The right tool always depends on 
the job, and the right tool for every imaginable job was just not yet 
invented.  :-)
The answer to your last question IMHO is: yes, you can, if the web layer 
is the only thing accessing your beans. But the subject of security is 
much more complicated in a real-life application than "what framework do 
I need to best implement it?"

You're welcome,

Marco Mistroni wrote:

>Hello all,
>	Sorry to get into this thread so late...
>Since I have same view as Daniel about Hibernate/EJBs, I wanted to ask
>one additional
>question, since right now I am using EJBs..
>Now, EJBs have some features that let the coder concentrate only
>On the business logic instead of dealing, for example, with
>synchronization, transaction, threading ..and security, meaning that you
>can declare in the
>Deployment descriptor which roles are allowed to do what with your EJBs.
>Where can you do the same with ORM tools?  In the web layer?
>Or do you have to have a security framework in place (such as acegi)?
>Thanx and regards
>	Marco

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message