Beginners can quickly get started with SpringBoot and learn to create projects

Springboot quick start learning

Spring Boot is a new framework provided by the Pivotal team. It is designed based on Spring 4.0. It not only inherits the original excellent features of the Spring framework, but also further simplifies the entire construction and development process of Spring applications by simplifying configuration.

SpringBoot features

  • Standalone Spring applications can be created, and based on its Maven or Gradle plugins, executable JARs and WARs can be created
  • Embedded Servlet containers such as Tomcat or Jetty
  • Provides an automatically configured "starter" Project Object Model (POMS) to simplify Maven configuration
  • Automatically configure Spring containers whenever possible
  • Provides ready-to-use features such as metrics, health checks, and externalized configurations for automatic configuration
  • Absolutely no code generation, no XML configuration required

SpringBoot important strategies

There are two very important strategies:

  1. Ready out of the box

    Out of the box, Outofbox refers to adding relevant dependency packages to the pom file of the MAVEN project during the development process, and then using corresponding annotations to replace cumbersome XML configuration files to manage the life cycle of objects. This feature allows developers to get rid of complex configuration work and dependency management work, and focus more on business logic.

  2. Convention over configuration

Convention over configuration is a software design paradigm in which SpringBoot itself configures the target structure and developers add information to the structure. Although this feature reduces some flexibility and increases the complexity of BUG location, it reduces the number of decisions developers need to make, reduces a large amount of XML configuration, and can automate code compilation, testing and packaging. .

SpringBoot architecture description

The basic architecture design of the SpringBoot application system development template is explained from the front end to the backend: the front end often uses template engines, mainly FreeMarker and Thymeleaf, both of which are written in Java language. They render the template and output the corresponding text, making the design and application of the interface Logical separation, while front-end development will also use Bootstrap, AngularJS, JQuery, etc.; the browser's data transmission format uses Json, not xml, and provides RESTful API; the SpringMVC framework is used to process requests after the data reaches the server; to data access The main layers include persistence layer frameworks such as Hibernate, MyBatis, and JPA; MySQL is commonly used as a database; IntelliJIDEA is recommended as a development tool.

Quick Start to Create a Project

1. Enter the spring official website: https://spring.io/

Insert image description here

There is start spring.io inside

Insert image description here

Start creating a project. You can create a maven project or a gradle project. Take the maven project as an example:

Insert image description here

OK, download-unzip. With a java environment, run it in cmd. The running command ismvn spring-boot:run

2. Create a maven project in the idea writing tool

file —newproject----spring initializr

Insert image description here

Click next, select the path, project name, and finish is created.
Insert image description here
After the project is successfully created, the directory structure is as shown in the figure!

Guess you like

Origin blog.csdn.net/weixin_47294072/article/details/106669691