web123456

The most detailed SpringBoot introductory nanny tutorials

Convention over Configuration, also known as programming by convention, is a software design paradigm

Essentially, the system, class library, or framework should assume reasonabledefault value, rather than requiring unnecessary configurations.

For example, if there is a User class in the model, then there will be a corresponding table in the database named User by default, and you will only need to write configurations for this name if you deviate from this convention.

For example, usually architects to build the project is to limit the software development of random code, to develop a set of specifications, so that the developers according to the unified requirements for the development of coding and testing and so on, which strengthens the efficiency of development and review of code efficiency. So that when you write the code needs to be named according to the requirements, so that a unified code will have a good readability and maintainability.

The essence of convention over allocation is thatFollow conventions and use as little configuration as possible

Spring Pros and Cons

vantage

Spring is a lightweight replacement for Java Enterprise Edition (Java Enterprise Edition, JEE, also known as J2EE). No need to develop heavyweight Enterprise Java Bean (EJB), Spring for enterprise Java development provides a relatively simple method through dependency injection and cut-oriented programming , with simple Java objects (Plain Old Java Object, POJO) to achieve the EJB function

drawbacks

Spring's component code is lightweight, but its configuration is heavyweightSpring 2.5 introduced annotation-based component scanning. But in the beginning, Spring required the use of XML configuration, and a lot of it.Spring 2.5 introduced annotation-based component scanning, which eliminated a lot of explicit XML configuration for the application's own components.Spring 3.0 introduced Java-based configuration, a type-safe, reconfigurable way to configure components instead of XML.

All of these configurations represent wear and tear during development. Because of the mind-switch between thinking about Spring feature configuration and solving a business problem, writing configurations takes time away from writing application logic. Like all frameworks, Spring is useful, but it also demands a lot in return.

Beyond that.Project dependency management can also be time-consuming and labor-intensiveWhen setting up the environment, you need to analyze which libraries you want to import. When setting up the environment, it is necessary to analyze which libraries' coordinates are to be imported, and it is also necessary to analyze the coordinates of other libraries that have dependencies on them. If the wrong version of the dependency is chosen, the ensuing incompatibility problems will seriously hinder the development progress of the project.

SSM Integration:Spring, SpringMVC, Mybatis, Spring-Mybatis integration package,database driverThe first is that it introduces a large number of dependencies and is prone to version conflicts.

SpringBoot to solve spring problems

SpringBoot on the above Spring's shortcomings to improve and optimize, based on the idea that the agreement is better than the configuration, you can let the developer does not have to configure the logic of the business between the thinking of switching to the logic of the business code writing, thus greatly improving the efficiency of the development of a certain degree to shorten the project cycle!

initial reliance

Starting dependency is essentially aMavenThe Project Object Model (POM), which defines pass-through dependencies on other libraries that add up to support a feature.

Simply put, starting a dependency is packaging together dependency coordinates that have some functionality and provide some default functionality.

auto-configuration

Springboot's autoconfiguration refers to the fact that springboot, automatically registers some configuration class beans into the ioc container, and we can use it where we need it using annotations such as @autowired or @resource.

The "automatic" form of expression is that we only need to quote the package we want to use the function, we do not have to care about the related configuration, springboot will automatically inject these configuration beans, we can directly use these beans

springboot: simple, fast , easy to build projects ; no configuration of the mainstream development framework integration ; greatly improve the development, deployment efficiency

SpringBoot Getting Started Tutorial


Requirement: request a method in the Controller and respond with the return value to the page

Creating a SpringBoot Project

Building a Spring Boot project using the Spring Initializr approach

  • Project SDK" is used to set up the creation of the project to use the version of the JDK, the project to use the previous initialization of the JDK version can be set up; in the "Choose Initializr Service URL (select the initialization service address)" under the use of the Default initialization service address" Perform Spring Boot project creation (note that the host must be online when using the fast way to create a Spring Boot project).

  • If you use a quick build of the Default way to create a SpringBoot project, you must use the network, the so-called quick build is the essence of the development tool to implement the parameters, the URL provided by Spring corresponding to the server to generate, Idea to speak of the server-generated SpringBoot project to download to the local space!

SpringBoot project structure analysis

Dependency management

4.0.0

spring-boot-starter-parent

2.6.1

springboot_demo

0.0.1-SNAPSHOT

springboot_demo

Demo project for Spring Boot

<>1.8</>

spring-boot-starter

spring-boot-starter-web

** Self-introduction, I graduated from Shanghai Jiaotong University in 13 years, once in a small company to stay, but also went to Huawei, OPPO and other large factories, 18 years into Ali has been to the present. **

Knowing that most Java engineers, want to improve their skills, often their own growth or enrollment classes, but for the training institutions moving thousands of tuition, really a lot of pressure. Their own unsystematic self-study effect is inefficient and long, and it is very easy to run into the ceiling technology stagnation!

Therefore, the collection of a "2024 Java development of a full set of learning materials", the original intention is also very simple, is that we hope to be able to help to want to self-study to improve and do not know where to start learning friends, while reducing the burden of everyone.img

There are both zero-basic material suitable for white people to learn, but also suitable for more than 3 years of experience partners in-depth learning to enhance the advanced courses, basically covering more than 95% of the Java development knowledge points, the real systematic!

Because the file is relatively large, here is just part of the directory screenshot out, each node contains a large factory interviews, study notes, source code handouts, real-world projects, explain the video, and will continue to update!

If you found this content helpful, you can scan the code to get it! (Remarks Java for access)

img

ultimate

最新大厂必问微服务面试题汇总:SpringCloud、Boot、Dubbo

最新大厂必问微服务面试题汇总:SpringCloud、Boot、Dubbo

最新大厂必问微服务面试题汇总:SpringCloud、Boot、Dubbo

Interview topics

image

image

image

image
Java interview questions analysis + core summary study notes + the latest video + real combat project source codeClick on the portal to get it!
The actual documentation can also be shared for learning**

[External image dump in progress...(img-EgZKELv4-1711888078746)]

[External image dump in progress...(img-GLuFdsNM-1711888078746)]

[External image dump in progress...(img-ZdGeNODL-1711888078746)]
Java Interview Questions Analysis + Core Summary Study Notes + Latest Explanation Video + Real-world Project Source CodeClick on the portal to get it!