Welcome to “Algorithms and the Beauty of Programming” ↑ pay attention to us!

This article was first published on the wechat official account “Beauty of Algorithms and Programming”. Please follow us and learn more about this series of articles in time.

1 Problem Description

In most of the small sprout new contact background this field, may be heard in the big mouth more is spring boot this combination of words. In the process of learning, the biggest problem you may encounter is the problem of entry. So the question comes, how to enter the background of this field is better? Here is my recommendation to get started in the field of Spring Boot.

2 Problem Analysis

In the background of this plate, I think the most important is the structure design of the database and the construction of the framework! Regardless of how to structure design, in the field of database framework construction often involved in the technology is usually SSM and Spring Boot. Both have their own advantages and disadvantages here. So which one is better for beginners?

3 Solution

Before we choose, let’s take a look at the basics of both:

1. What is Spring Boot?

Essentially, Spring Boot is Spring, and it does all the Spring Bean configuration that you would have done without it.

2. What are the advantages of SpringBoot?

Spring has been known as “configuration hell” for its cumbersome configuration of XML and Annotation configurations, which can be dizzying and hard to figure out when things go wrong.

SpringBoot helps developers quickly launch a Web container;

SpringBoot inherits the good DNA of the original Spring framework;

SpringBoot simplifies the process of using Spring.

3. Disadvantages of SpringBoot?

As a microframework, Spring Boot is still far from the implementation of microservices. If no corresponding service discovery and registration functions are provided, the monitoring function provided by acturator must be connected to the existing monitoring function. If there is no matching security control solution, you need to standardize URIs based on the actual situation.

4. What is SSM?

SSM (Spring+SpringMVC+MyBatis) framework is integrated by Spring, SpringMVC and MyBatis, and is often used as the framework of Web projects with relatively simple data sources. Spring is a lightweight inversion of Control (IoC) and AOP oriented container framework.

SpringMVC separates the roles of controller, model object, dispatcher, and handler object, which makes them easier to customize.

MyBatis is an excellent persistence layer framework that supports ordinary SQL queries, stored procedures, and advanced mapping.

5. Advantages and disadvantages of SSM?

The pros and cons of the SSM should be separate, for example

1) Spring does not say, core IOC, AOP technology, IOC decoupling, so that code reuse, maintainability is greatly improved, AOP provides faceted programming, the same enhanced productivity.

2) SpringMVC, compared with Other MVC frameworks such as Struts2, not only struts2 exposed so many security vulnerabilities, but also class interception, all Action variables are shared, and filter entry, while Spring MVC is method interception. The Controller has its own request Response data, using serlvet entry, and seamlessly integrates with Spring. In terms of development, Spring MVC is much lighter and lower entry level.

3) Mybatis, depending on the business scenario, mainly myBatis SQL can be controlled and tuned by developers, compared with Hibernate and other ORM frameworks, it is more intuitive. In the business scenario is more complex, SQL associated with a lot of cases, mybatis who use who knows. The downside, of course, is that developers who are not familiar with SQL are not very friendly.

How do the two compare? Let’s look at the comparison: SSM is a WEB application framework that covers the entire application layer, while Spring Boot you can think of as a startup, configuration, rapid development aid framework that is itself targeted at microservices. So SSM is a little bit more extensive in terms of functionality and Spring Boot is a little bit more micro. In comparison, SSM is more suitable for qualified programs who have completed the entry, while Spring Boot is simpler and friendlier for Xiaomengxin, because there is no complicated project creation and a series of procedures for Xiaomengxin.

About the first Spring Boot, the first application created:

The first recommended editing software is: InterlliIDEA

(1) Create new projects:

(2) Select Spring Boot and set the correct JDK path and Spring URL

(3) Next, go to this page and set the project name and so on

(4) Add Spring components to the project

For now we just need to check web

(5) Select the save path (note: the path should not appear in Chinese)

Then finish

(6) Create the corresponding hierarchical folder and class under the corresponding folder

Learn about maven configuration files:

Understand the class:

Create the first class HelloContruller:

4 summarizes

In the background of the study need many progressive, introduction to choose a suitable starting point for sprout new also reduce the burden of a lot, so in the choice of technology introduction, less as far as possible choose function, basic technology for learning, the learning process can reduce the unnecessary waste of time, but also for the back of the study to lay a good foundation. Finally, I hope my article can let you find a good beginning in this field of backstage!

More interesting articles:


Tips: Click on the lower right corner of the page “Write a message” to comment, looking forward to your participation! Looking forward to your forwarding!