GeeCON Prague 2014*
The moose likes Struts and the fly likes Struts 2 best pracrice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 best pracrice" Watch "Struts 2 best pracrice" New topic
Author

Struts 2 best pracrice

yajun wen
Greenhorn

Joined: Oct 31, 2007
Posts: 2
Many projects integrate Struts, Spring, Hibernate, JSF, etc. together. What is the best practice using struts 2? Do we need so many frameworks together?
Don Brown
author
Greenhorn

Joined: Apr 22, 2008
Posts: 25
No, there is not need to use what you don't want. I'd suggest starting small and then add other libraries or frameworks as needed, particularly if you are not familiar with them. That said, Struts 2 has plugins that integrate with a number of frameworks you mention.
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
Integration of different frameworks together is usually done because each framework is intended for a specific task. Hibernate for example is great for DB access, since it maps your DB tables to the object domain, so you don't have to go into the usual JDBC hassle. It also hides DB implementation and vendor specific SQL from the developer. Spring is great for wiring multi-tier applications, and it integrates with different frameworks to make your development easier, and make you concentrate on your business logic. It supports and eases up AOP, and lots of other features. Velocity is great for templating, while tiles and site mesh are great for creating web views. We cannot have a framework that will give us all of these stuff just to not integrate different projects together. Even spring itself, having so many features, it's divided into modules that you can use separately, and some are even separate sub projects.

To sum it up, you'll always have to have several projects integrated together to make the most benefit.


Visit my blog: http://jnassef.blogspot.com/
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
Originally posted by Don Brown:
No, there is not need to use what you don't want. I'd suggest starting small and then add other libraries or frameworks as needed, particularly if you are not familiar with them. That said, Struts 2 has plugins that integrate with a number of frameworks you mention.


Seems that we have a small disagreement here. Anyway, I don't say that you HAVE to use everything, but for large projects to increase productivity, struts or struts 2 alone is not enough. My previous post was mainly answering the question "We did that with struts 1, now with struts 2, can we ditch all this?". My answer was obviously no. If you did that with struts 1, then do it with struts 2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts 2 best pracrice