• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Design related doubt

 
Srini vasu
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

I am new to struts.please clarify my doubt below:

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).

So how to manage with only struts and hibernate.

Thank you,

Srini.
 
Srini vasu
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody please clarify my doubt.


Thanks,
Srini.
 
Leandro Melo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srini.

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.
 
Srini vasu
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Leandro Melo,

Thank you for your clarification, I will try to find out different startagies for wrting Business logic.


Thanks alot,
Srini.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic