3

For example, we have the next bunch: Struts, Spring, Hibernate. Can you help me understand the role played by each of the elements?

I know that Hibernate is responsible for all on the database.

But, what role Struts and Spring in this case?

Thanks.

Buhake Sindi
  • 87,898
  • 29
  • 167
  • 228
user471011
  • 7,104
  • 17
  • 69
  • 97
  • [Here](http://stackoverflow.com/questions/2841212/what-is-the-difference-between-spring-struts-hibernate-javaserver-faces-tape) is some explanation. – Fred Nov 18 '11 at 13:17

4 Answers4

6

Struts is web application framework - used to give you the possibility to expose your application through web interface without dealing with low level classes. When using struts you should be careful as there often bad advices on using you application logic inside struts classes. Don't do this, struts is just web front-end.

Spring is general application framework that in first place helps you decouple classes from one another using dependency injection. But this is not the only reason for using spring, it provides tons of other features: http security, aspect oriented programming, out-of-the-box integrations and support of different frameworks. So this gives you a fast start on using different technologies.

Hibernate is object relational mapping. Using it you map your classes to database relations and avoid working with SQL requests.

pavel_kazlou
  • 1,995
  • 4
  • 28
  • 34
4

My guess:

Struts is used for presentation purposes. Spring is used for AOP, and Depency Injection. Hibernate is obvious: persistence.

Buhake Sindi
  • 87,898
  • 29
  • 167
  • 228
3

Spring:

  • Dependancy injection
  • Transaction Management.
  • Open Session in View Filters
  • Spring Security.
  • or in other words nice clue to between application layers.

Struts:

  • Model and view Design pattern.
  • Simplifies web flow.
David
  • 15,894
  • 22
  • 55
  • 66
danny.lesnik
  • 18,479
  • 29
  • 135
  • 200
1

Struts is for webapplication preparation. It has great form validation f/w, and tiles f/w to create webapplication in a great way.

Spring has 6 modules. It provides abstraction on the java-j2ee application. Spring MVC provides abstraction for struts.

benka
  • 4,732
  • 35
  • 47
  • 58