May I know what is the difference between:-
Are these technologies/framework complementary to each other? Or they are alternatives to each other (after I use one of them, then I don't need to use the other)?
Thanks.
This question is related to
java
frameworks
jakarta-ee
Generally...
Hibernate is used for handling database operations. There is a rich set of database utility functionality, which reduces your number of lines of code. Especially you have to read @Annotation of hibernate. It is an ORM framework and persistence layer.
Spring provides a rich set of the Injection based working mechanism. Currently, Spring is well-known. You have to also read about Spring AOP. There is a bridge between Struts and Hibernate. Mainly Spring provides this kind of utility.
Struts2 provides action based programming. There are a rich set of Struts tags. Struts prove action based programming so you have to maintain all the relevant control of your view.
In Addition, Tapestry is a different framework for Java. In which you have to handle only .tml
(template file). You have to create two main files for any class. One is JAVA class and another one is its template. Both names are same. Tapestry automatically calls related classes.
Spring is an application framework which deals with IOC (Inversion of Control).
Struts 2 is a web application MVC framework which deals with actions.
Hibernate is an ORM (Object-Relational Mapping) that deals with persistent data.
You can see the overview and ranking for yourself here. Hibernate is an ORM, so you can use either struts+Hiberante or spring+hibernate to build a web app. Different web frameworks and many are alternatives to each other.
In short,
Struts is for Front-end development of website
Hibernate is for back-end development of website
Spring is for full stack development of website in which Spring MVC(Model-View-Controller) is for Front-end. ORM, JDBC for Data Access / Integration(backend). etc
In hibernate you need not bother about how to create table in SQL and you need not to remember connection ,prepared statement like that data is persisted in a database. So, basically it makes a developer's life easy.
Difference between Spring, Struts and Hibernate are following:
Tapestry pages and components are simple POJO's(Plain Old Java Object) consisting of getters and setters for easy access to Java language features.
Spring is a light weight and open source framework created by Rod Johnson in 2003. Spring is a complete and a modular framework, Spring framework can be used for all layer implementations for a real time application or spring can be used for the development of particular layer of a real time application.
Struts is an open-source web application framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model–view–controller (MVC) architecture. It was originally created by Craig McClanahan and donated to the Apache Foundation in May, 2000.
Listed below is the comparison chart of difference between Spring and Strut Framework
Source: Stackoverflow.com