Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What technologies are best for my application: Struts with Hibernate or Spring with Hibernate

I have a working knowledge of Struts2 and Spring. I want to develop an application that manages information for multiple companies. I am totally confused about what technologies are best for my application. For instance: Struts2, and Hibernate MVC with Spring. Can somebody help me select appropriate technologies?

like image 243
subodh Avatar asked Dec 02 '22 03:12

subodh


2 Answers

Here is a quick breakdown of a J2EE stack you can use:

  1. Use Struts2 for your controller layer

  2. Use Hibernate for your data abstraction layer. Create service interfaces for your DAO. The interfaces will allow you to use some type of RMI for services later if desired, meaning those services can run on different machines than your web app. Have concrete classes implement those interfaces. The classes will contain business logic and validation of data, and will wrap the Hibernate session. The Hibernate session is used to read/write to/from the database. Use Hibernate annotations to expedite the implementation of Hibernate beans.

  3. Use Spring for instantiating your service classes and Struts2 actions. Configure Spring to inject service instances into your Struts2 actions. This is called dependency injection. Reference interfaces, not classes in your Struts2 action's setter methods for the DI.

  4. Use the Struts2 tag library or JSTL in your JSP, which will be your view layer.

  5. Use Maven for your builds and deploys.

  6. Run Apache with mod_jk, and use Tomcat as your servlet container. mod_jk runs w/ the Apache process, and passes requests to the Tomcat servlet container, which lives in the JVM.

  7. If your application requires search capabilities, use SOLR, a REST service built on top of Lucene.

  8. Instead of using Struts2, you could also take a look at Apache Wicket.

like image 176
Simian Avatar answered Mar 18 '23 11:03

Simian


I had the same question few days back and following are the links I used to make a decision - I settled for Spring MVC. Also check out Spring ROO if you are starting afresh.

  1. Choosing the right web framework
  2. Comparing web frameworks
  3. What Web Application Framework?

Ultimately choice will be based on your needs - but above links discuss what parameters you should consider before choosing one.

Hope that helps.

like image 24
Nilesh Avatar answered Mar 18 '23 13:03

Nilesh