Home>Article>Java> What is the difference between spring and springmvc?

What is the difference between spring and springmvc?

青灯夜游
青灯夜游 Original
2020-07-15 18:07:47 12350browse

The difference between spring and springmvc: Spring is a container framework for IOC and AOP; and SpringMVC is a Web framework based on Spring functions. If you want to use SpringMVC, you must first rely on Spring; SpringMVC is a WEB development framework in MVC mode.

What is the difference between spring and springmvc?

The difference between spring and springmvc

Spring is a container framework for IOC and AOP. SpringMVC is a web framework added based on Spring functions. If you want to use SpringMVC, you must first rely on Spring.

Spring can be said to be a container that manages beans, or it can be said to be a general term that includes many open source projects;

spring mvc is one of the open source projects, so if you follow a simple process, http request Once it arrives, the container (such as Tomact) parses the http and makes it a request. Through the mapping relationship (path, method, parameter), the spring mvc distributor finds the bean that can handle the request. Then the tomcat is managed by spring. It is found in a bean pool (bean container), and the response is returned after processing.

SpringMVC is a WEB development framework in MVC mode;

Spring is a universal solution. Its greatest use is to reduce software complexity through Ioc/AOP decoupling, so Spring can be combined with SpringMVC Used together with many other solutions, it is not only suitable for WEB development

#SSH:

SSH is an integrated framework of struts spring hibernate and is currently more popular An open source framework for JAVA web applications.

Struts

Struts is an MVC framework based on the Sun J2EE platform, which is mainly implemented using Servlet and JSP technology. Because Struts can fully meet the needs of application development, is simple to use, agile and fast, it has attracted much attention in the past year. Struts integrates Servlets, JSP, custom tags and message resources into a unified framework. When developers use it for development, they no longer need to code themselves to implement a full set of MVC patterns, which greatly saves time, so Struts It is a very good application framework.

Official address: http://struts.apache.org

Spring

Spring is a solution to many common problems in J2EE development powerful framework. Spring provides a consistent way to manage business objects and encourages the good habit of programming to interfaces rather than classes.

The architectural foundation of Spring is based on the Inversion of Control container using JavaBean properties. However, this is only part of the complete picture: Spring is unique in using IOC containers as a complete solution that focuses on all architectural layers.

Spring provides the only data access abstraction, including a simple and efficient JDBC framework, greatly improving efficiency and reducing possible errors. Spring's data access architecture also integrates Hibernate and other O/R mapping solutions.

Spring also provides the only transaction management abstraction, which can provide a consistent programming model across various underlying transaction management technologies, such as JTA or JDBC transactions.

Spring provides an AOP framework written in standard Java language, which provides declarative transaction management and other enterprise affairs for POJOs - if you need - you can also implement your own aspects.

This framework is powerful enough to enable applications to put aside the complexity of EJB while enjoying key services related to traditional EJB. Spring also provides a powerful and flexible MVC Web framework that can be integrated with IoC containers.

Official address: spring: http://www.springsource.org

Hibernate

Hibernate is an open source object-relational mapping framework , which implements a very lightweight object encapsulation of JDBC, allowing Java programmers to use object programming thinking to manipulate the database as they wish.

Hibernate can be used in any situation where JDBC is used. It can be used in Java client programs or in Servlet/JSP Web applications. The most revolutionary thing is that Hibernate can be used in EJB applications. It replaces CMP in the J2EE architecture and completes the important task of data persistence.

Official address: http://www.hibernate.org

Recommended tutorial: "java tutorial"

The above is the detailed content of What is the difference between spring and springmvc?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn