Struts vs Spring MVC


General J2EE: Struts vs Spring MVC

  1. Struts vs Spring MVC (1 messages)

    guys, hi this is my first time coming here, i have searched a lot about the frameworks but still have no idea which framework is suitable and the best for the Java Web-Based Application, I really dun know what to do ? and also im very new to J2EE, im feeling im lost between all these architectures and frameworks, recently I got introduced to AppFuse but i need to make a raodmap for myself, I want to start to work and learn a very good framework that can help me get a job in near future.any help would be appreciated.

    Threaded Messages (1)

  2. Re: Struts vs Spring MVC[ Go to top ]

    First, learn the high level of how JEE MVC works in general. See if you understand. Once you know what it is for and how you use it, then think about creating the following: Small app (10 jsp pages, 8 controllers, 5 DAO, 6 Business Logic Objects) v.s. Large app (100 jsp pages, 80 controllers, 60 DAO, 50 Business Logic Objects) Do you need to organize your JSP and resource in a better way for large app that you do not run into trouble in terms of scalability, maintainability and SDLC? Framework is exactly there to help you for this. Struts and Spring are both famous frameworks that help developers who want to create applications without worrying too much of code design (low level) and dirty stuff like controller forward/redirect path. If you don't use them, you will run into hell of hardcoded JSP/Servlet for forward/redirect strings and lots of other stuff. Basically, Struts and Spring creates placeholders for developers to fill in the business logic using the industry standard design pattern such as MVC and DAO. To create thousands of DAOs, you simply kill yourself; instead you rely on SpringFrameWork DAO template, it saves you lots of duplicated code. Struts is good for small applications, 10 to 50 pages are okay and your application view logic better be not too complicated. Spring offers a lot more than just view logic. SpringFrameWork covers multi-tiers areas. In view logic, it has Spring MVC (Spring portlet MVC), in business logic, it has IoC for you to create "plugin" of your application and persistance layer Spring provides DAO and Persistance template so you don't need to dig into too much of individual framework like hibernate (of course you still need to know how to use hibernate but at least not to worry about complicated setup). Obviously, Spring is for medium and large applications. It is designed to have complicated view logic as well. Choice is up to you but I tried both, I'd like to use Spring since it is just like "All-in-One" package for you to develop full feature applications.