aspose file tools
The moose likes Struts and the fly likes help sought in understanding struts, ejb , hibernate? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "help sought in understanding struts, ejb , hibernate?" Watch "help sought in understanding struts, ejb , hibernate?" New topic
Author

help sought in understanding struts, ejb , hibernate?

gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 895

this may not be the right forum for this question . but i would like to know what is the difference between EJB and Hibernate and EJB and Struts 2. ?


OCPJP 6(100 %) OCEWCD 6(91 %)
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8291

As I pointed out in your earlier post, Struts, regardless of version, is an implementation of the Front Controller pattern.
EJB and Hibernate are primarily Object Relational Maps, used to interface with databases (EJB's have a lot more functionality, for example, they do not necessarily have to be backed by a database table and can do other things like process messages from a queue).


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 895

Joe Ess wrote:As I pointed out in your earlier post, Struts, regardless of version, is an implementation of the Front Controller pattern.
EJB and Hibernate are primarily Object Relational Maps, used to interface with databases (EJB's have a lot more functionality, for example, they do not necessarily have to be backed by a database table and can do other things like process messages from a queue).


i don't have much idea about j2ee design patterns, but does struts as an implementation of Front controller pattern means that it CANNOT be used in the business/infrastructure layer of our web application ? also what about spring ? can we use spring in both the presentation layer and business/infrastructure layer ?

can we say that spring is superset of struts in that it can do whatever struts 2 can do but not vice versa ?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8291

gurpeet singh wrote:
but does struts as an implementation of Front controller pattern means that it CANNOT be used in the business/infrastructure layer of our web application ?


For the most part, yes, but that statement comes with a caveat: Struts has a lot of functionality that is not strictly part of the Front Controller pattern (the ModelDriven interface, for instance) that may intrude into the "business logic" part of an application.

gurpeet singh wrote:
also what about spring ? can we use spring in both the presentation layer and business/infrastructure layer ?


I haven't worked with Spring, but from what I understand it is a more comprehensive framework, including front end functionality (Spring Web) as well as back-end tasks (Security, ORM).

gurpeet singh wrote:
can we say that spring is superset of struts in that it can do whatever struts 2 can do but not vice versa ?


I would say that they are frameworks that take two different approaches to making developers more productive. You would be hard pressed to find a use case for Spring that could not be done in Struts. Whether or not it is easier with one framework or the other is left up to the developer to decide.
You can also use Spring in conjunction with Struts, to make the decision process even murkier.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: help sought in understanding struts, ejb , hibernate?
 
Similar Threads
Industry use of EJB's
j2ee Problem
who's waiting for ejb 3?
middlegen - no ejb?
Frameworks according to layers