Recent Posts

Friday, 9 August 2019

Spring MVC Part 1

     The main intention of Spring WEB MVC module is to prepare web applications with MVC design patterns.
To prepare web applications we have already Struts1 Framework then what is the requirement to use Spring Web MVC Module?
1. Struts is Web Framework, it able to provide very good environment to prepare and execute web applications.
     Spring Framework is an application Framework, it able to provide very good environment to prepare any type of application like Standalone applications, web applications, Distributed applications.
2. Struts framework is mainly MVC based frame work, it able to use only MVC and its corelated design pattern.
     In Spring framework, only Web Module is able to use MVC Design Pattern.
3. Struts Framework is heavy weight Framework.
    Spring Framework is light weight Framework.
4. Struts framework is able to provide tightly coupled design for its applications.
     Spring framework is able to provide loosely coupled design for its applications.
5. Struts is not providing clear separating between Controller layer, Beans Model and View part.
     Spring Framework is able to provide clear separation between controller layer, Model and View part.
6. Struts is not providing very good environment to integrate other technology applications like JDBC, Hibernate, EJBs etc.
     Spring is providing very good environment to integrate other technology applications like JDBC, Hibernate etc.
7. Struts is able to use only HTML, JSP etc. basic view related tech to prepare View part.
    Spring is able to provide very good environment to use view related tech like HTML, JSP, velocity, Free marker etc.
8. Struts is not having AOP implementations to provide loosely coupled design.
     Spring is supporting AOP implementations to provide loosely coupled design.
9. Struts is not layered/Modularized Framework.
     Spring is layered/Modularization Framework.
10. Struts framework is able to provide very good Tag library to prepare view part.
     Spring framework is not providing good tag library to prepare view part.
11. Struts is not providing support for Transaction Management and Messaging Support.
    Spring is providing very good Transaction management and Messaging support for its applications.

To prepare MVC Based Web Applications we have already JSF [Java Server Faces] then what is the requirement to use Spring Web MVC Framework?
1. JSF is web framework, it able to provide environment to prepare web applications only.
     Spring Framework is an application Framework, it able to provide very good environment to prepare any type of application like Standalone applications, web applications, Distributed applications
2. JSF is Component based Framework, for every view, JSF will create a Component Tree in order to manage data.
     Spring Framework is not Component based Framework, it will use Beans to manage Form data.
3. JSF is View layered Framework, it will focus on View Layer.
     Spring is not View Layered Framework, it will focus on all layers of the Enterprise Applications.
4. JSF is having very good Convertors, Validations and Rendering Mechanisms.
     Spring is not having good Convertors, validations and Rendering Mechanisms.
5. JSF is having inbuilt AJAX support.
     Spring is not having inbuilt Ajax support.
6. JSF is not having Middleware Services support like Transactions, Messaging etc.
     Spring is having very good support for Transactions, Messaging etc.
7. JSF is not having any integration environment to integrate other technologies applications like JDBC, EJBs, RMI etc.
     Spring is providing very good environment to integrate other technologies applications like JDBC, EJBs, Hibernate, Struts etc.
8. JSF is not having very good Security implementations.
     Spring is having a separate Security module to provide security.

Spring Web MVC Features
1. Spring Web MVC contains no of components like controller, validator, command object, form object, model object, DispatcherServlet, handler mapping, view resolver, and so on, Each and every component has its own roles and responsibilities.
2. Spring framework allows Powerful and straightforward configuration of both framework and application classes as JavaBeans. This configuration capability includes easy navigation across contexts, such as from web controllers to business objects and validators.
3. Spring Framework is allowing Command and Form objects to reuse Business code instead of extending Frameworks provided API libraries.
4. Spring Web MVC is providing very good Data Binding Mechanisms, Data Validations for web applications.
5. Spring Web MVC is providing Customizable handler mapping and view resolution.
6. Spring Web MVC module is more Flexible model transfer. Model transfer with a name/value Map supports easy integration with any view technology.
7. Spring Web MVC provides customizable locale and theme resolution, support for JSPs with or without Spring tag library, support for JSTL, support for Velocity without the need for extra bridges, and so on.
8. Spring Web MVC allows all JSP supported Tag Libraries like JSTL tag libraries

Next Tutorial : Spring MVC Part 2

Previous Tutorial : Spring Transaction Management

5 comments: