What is the difference between springs, Struts, Hibernate?

Struts: View (User Interface) 
Spring: Service Layer 
Hibernate: DAO layer 




Struts:
Struts is a web framework which can be used to develop web applications using MVC pattern. We have to hard code to use applications like hibernate, jdbc, etc.

Struts framework is based on MVC pattern to develop web applications and which is used to generate integration logic dynamically.
Struts allow only JSP as a view component.
Struts are an action-based presentation framework (but don't use it for a new development).
Struts 2 is an action-based presentation framework, the version 2 of the above (created from a merger of Webworm with Struts).
Struts framework is mainly used for Web Applications Actually Struts framework is all are classes not implements the interface.

Whenever develop application in two ways:
Programming through interface 
Programming through class

Struts drawbacks:

1.Better way is Programming through interfaces so that struts not support that (i.e. all are predefined class... Action, DiaspatchAction, and SwitchAction)
2.This framework is tight coupling. It is not separated layer wised
3.It is not Support to Dependency Injection
4.We have to hard code to use applications like hibernate, jdbc, etc. 



Spring:
Spring is an IoC container (at least the core of Spring) and is used to wire things using dependency injection.
Spring provides additional services like transaction management and seamless integration of various other technologies.
It is used to develop enterprise applications.
It not only allows JSPs but also other views such as Velocity, Freemaker etc.,
It consists of 6 modules which are alternatives for existing J2ee Technologies. 
It is used to combine things together and provides Declarative transaction management.
The java Objects do not persist in a relational database.
Spring is an application framework in which spring MVC is one of the modules of spring framework. Spring uses the concept of IOC/DI where the objects are not hard coded in
java but they are injected using constructor/setter injection. We can use hibernate, jdbc, etc,...with spring without hard coding in application as spring supports classes hibernate, jdbc, and many more. This is very little to say about spring. There are many features to be known. 
It support’s DI.
It is layer wise designed.
It is loose coupling
Spring support MVC and Other MVC 
Spring Application always flow Design Patterns
Spring support to POJO'S AND POJI(i.e. it is not API dependent)

Hibernate:
Hibernate is an object-relational mapping tool, a persistence framework.
It doesn’t have any Declarative transaction management.
Persists the java objects in a relational database.


SHARE

About df

    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment