The difference between SSM and SpringBoot

Essential difference:

1. SSM is a combination of three stooges, Spring IoC, Spring MVC, and Mybatis;

2. Zhuge Liang of SpringBoot is not bound to any MVC framework.

Let's talk about the essential difference between Spring Boot and SSM in detail.

What is SSM? It is a combination of three stooges (Bi), Spring loC, Spring MVC, and Mybatis. SSM is limited, you can only develop Java Web applications, and the MVC framework must use Spring MVC, the persistence layer must use Mybatis, and nothing else! I said that SSM includes these, but you can't add them on the basis of these three. Other frameworks and libraries go up.

What about Spring Boot? Zhuge Liang. With Zhuge Liang, you have more options for using soldiers, and no matter which generals you use, the army will go more smoothly. Spring Boot is not bound to any MVC framework! Not bound to any persistence layer framework! Not bound to any other business domain framework!

You can use Spring Boot to develop web applications. Use spring-boot-starter-web to configure Spring MVC for you. You don't want to use Spring MVC, can you use Spring WebFLux (with spring-boot-starter-webflux) to write responsive web applications? Of course, and this is the new web framework promoted by Spring 5.

You do not develop web applications, but only implement pure data layer services. You can also develop Spring Cloud Stream and Task.

For the data persistence layer, you can use any sub-project under the Spring Data project
JPAJDBC MongoDB Redis LDAP Cassandra Couchbase Noe4Hadoop Elasticsearch....
Of course, you can also use Mybatis, which is not officially supported by Spring. Just use the spring-boot-starter-xxx of the corresponding technology or framework.

But you must know

Spring Boot provides only these starters, these Starters depend on (maven dependence) the corresponding framework or technology, but do not contain the corresponding technology or framework itself!

This is where many people use the term "family bucket" to describe Spring Boot wrong. The KFC McDonald's Family Bucket contains drumsticks, wings, and nuggets, all of which are included and not optional. (Insert an advertisement: If you need to open a genuine IDEA, you can contact me, 56 yuan a year, the genuine license is activated, the official website can check the validity period, if you need it, add me on WeChat: poxiaozhiai6, remarks: 912.) This is what you have eaten, eat Not all are these. You like to eat some of them, and you may not like to eat some of them. But Spring Boot is not. Spring Boot does not include Spring MVC, does not include Mybatis, only their corresponding starters.

A more appropriate analogy is that Spring MVC, Spring Data, and Websocket correspond to the graphics card, sound card, hard disk, and network card of the computer hardware. The Starters provided by Spring Boot correspond to the drivers of these hardware. As long as you plug these hard drives on the motherboard, the corresponding drivers provided by Spring Boot will allow you to enjoy a Plug & Play experience. What Spring Boot provides is the driver, which does not include the hardware itself such as graphics card and sound card. These drivers can make your DIY computer boot and run smoothly.

Many common third-party frameworks on the Java server side 9, Spring Boot can help you configure them by default in the way of Convention over Confiquration.

See what is supported here: Spring Boot Reference Guide

おすすめ

転載: blog.csdn.net/qq_41701956/article/details/126815458