Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What are the benefits of using Spring MVC to implement Enterprise Application? Why should I use Spring MVC?

user-image
Question ajoutée par محمد حسام الدين حسن صدقى , Senior Functional Consultant , Egabi Fsi
Date de publication: 2016/08/28
Surajit Chowdhury
par Surajit Chowdhury , Senior Software Engineer , Detroit Engineering products

Spring is a powerful Java application framework, used in a wide range of Java applications. It provides enterprise services to Plain Old Java Objects (POJOs). Spring uses dependency injection to achieve simplification and increase testability.

1. Spring provides a very clean division between controllers, JavaBean models, and views.

2. Spring’s MVC is very flexible. Unlike Struts, which forces your Action and Form objects into concrete inheritance (thus taking away your single shot at concrete inheritance in Java), Spring MVC is entirely based on interfaces. Furthermore, just about every part of the Spring MVCframework is configurable via plugging in your own interface. Of course we also provide convenience classes as an implementation option.

3. Spring, like WebWork, provides interceptors as well as controllers, making it easy to factor out behavior common to the handling of many requests.

4. Spring MVC is truly view-agnostic. You don’t get pushed to use JSP if you don’t want to; you can use Velocity, XLST or other view technologies. If you want to use a custom view mechanism – for example, your own templating language – you can easily implement the Spring View interface to integrate it.

5. Spring Controllers are configured via IoC like any other objects. This makes them easy to test, and beautifully integrated with other objects managed by Spring.

6. Spring MVC web tiers are typically easier to test than Struts web tiers, due to the avoidance of forced concrete inheritance and explicit dependence of controllers on the dispatcher servlet.

7. The web tier becomes a thin layer on top of a business object layer. This encourages good practice. Struts and other dedicated web frameworks leave you on your own in implementing your business objects; Spring provides an integrated framework for all tiers of your application.

8. No ActionForms. Bind directly to domain objects

9. More testable code (validation has no dependency on Servlet API)

10. Struts imposes dependencies on your Controllers (they must extend a Struts class), Spring doesn’t force you to do this although there are convenience Controller implementations that you can choose to extend.

11. Spring has a well defined interface to business layer

12. Spring offers better integration with view technologies other than JSP (Velocity / XSLT / FreeMarker / XL etc.)

soubhagya kumar bitt
par soubhagya kumar bitt , Technical Lead , IBM india

The main 4 key strategies of spring will simplify the development of an enterprise Java application.

  1. Spring is light weight and It minimally invasive development with POJO.
  2. Spring achieves the loose coupling through dependency injection and interface based programming.
  3. Declarative programming through aspects and common conventions.
  4. Boilerplate reduction through aspects and templates.

Jamal Javed
par Jamal Javed , Software Engineer , MFSYS Software and Systems (Pvt.) Ltd

Ok here is the simple answer Spring MVC is a framework like anyother framework which uses MVC pattern. Now what is MVC its the model view controller which you probably have heard of, the beauty of MVC is separation of concern which leads to well management of your code and facilitates you with many other things.

Kais Hamdulay
par Kais Hamdulay , Technical Lead , Barclays

To make complex application work faster.

Each one of model view and control does its task of  playing with data displaying data and controlling the flow of data.

 

Mumtaz Khan
par Mumtaz Khan , Lead software engineer , Sabre Holdings

First of Spring is open source meaning it's free and you can look at the code to see how the framework itself works. It has been used by large and small companies and has good reputation and backing. 

Just like any MVC framework, Spring MVC allows you to write code in a organized way so that business logic can go in controllers and does the views stay clean and have only display logic. While model can represent the backend data.

 

Also Spring has been used by large companies and been tested for performance. 

qaeed ramiwala
par qaeed ramiwala , Lead Java Developer / Software Engineer , CellPoint Mobile

Spring MVC gives you a baseline architecture to create your own Enterprise level applications which works on the notion of model-view-controller modeling. Also spring gives you additional plug and play services or modules which can be integrated into your existing enterprise applications based on your own requirements. e.g. Security is an integral requirement for any business application. You can use Spring security module to implement secure authentication. One might also want ORM based architecture where Spring DATA (JPA & ORM)  module will certainly an option to go by and there are many more such plug & play modules Spring has.

Seeranga Bandara
par Seeranga Bandara , Senior Software Engineer

MVC is Model View Controller. Use of MVC will separate model,view and  control of enterprise application clearly. The Spring MVC has introduce more value to MVC. It has a thin view component. The flexibility is very high in Spring MVC, therefore its a big advantage for enterprise application. Development is easy with compared to other frameworks and its has lot of features for most of the daily used software functions(eg: JOBS in Spring Framework)

More Questions Like This