Can we use struts and hibernate with out spring frame work. I know Hibernate is a persitant framework. If we are using only struts and hibernate, do we need to write model classes again for business logic(As hibernate is used for persistant logic).
Yes, you can use Struts, Hibernate and Spring together. Using Struts and Hibernate together is easy and direct, since each framework stands in different ends of your application. Struts will provide the front controller (as usual) with other resources and Hibernate the back end persistence.
Spring requires some extra configuration, but it should not be difficult to plug it in together, because it is already prepared to work with both Struts and Hibernate (along with other frameworks). However, you'll have to use Struts and Hibernate in the way Spring "tells" you to do.
About business logic, I think it's a deeper issue (maybe you can start such discussion in another forum). Some people don't write business logic in the persistent classes (they write in session beans, for example). Other people write only simple business logic in persistent classes. There're also people that prefer to write business logic in POJOs and make them agnostic (somehow) of the persistent mechanism. Where I currently work, most business logic is writen in the persistent classes. So, you might wanna search around for good strategies of where to place business rules and make your decision.
SCJP 1.4, SCWCD 1.4
Joined: Jun 08, 2007
Hi Leandro Melo,
Thank you for your clarification, I will try to find out different startagies for wrting Business logic.