The most comprehensive Alibaba architect SSM framework notes source code analysis and decryption sharing in the entire network

table of Contents

In-depth analysis of Spring source code

In-depth analysis of SpringMVC source code

In-depth analysis of MyBatis source code


SSM is the abbreviation of Spring+Spring MVC+MyBatis. It is the mainstream JavaEE enterprise framework after SSH and is suitable for building various large enterprise application systems. Spring relies on DI to manage the components of each layer, and uses AOP (Aspect Oriented Programming) to manage transactions, logs, permissions, etc. Spring MVC represents Model (model), View (view). Contoller (control) to receive external requests and distribute and process them. MyBatis is a JDBC-based framework that is mainly used to manipulate databases and connect business entities with data tables.

I have read Spring's loC. AOP and MVC and I still benefit a lot. A good framework can let you know the past, present, and future, and Spring can be one of them.

Summarized some of the pain points of middle and senior Java engineers and gave a good solution.

(1) High house construction. Framework foundation and domain model are the soul of a framework. This book explains the soul thought in a simple and simple way, so that the framework's ability and development track can be followed by rules.

(2) Highlight the key points. The core functions of Spring are all prominent, including loC. AOP. MVC and related RPC calls. A classic framework is difficult to cover everything, but the core function that people use smoothly,-must be tempered through thousands of ways. Spring's core design patterns are explained in this book.

(3) Pay attention to systematization. The author spent a lot of space on MyBatis, which is also the highlight of this book. The author maps SQL in a simple way. In-depth content such as SQL parsing, executors, and caching mechanisms are presented to us. When faced with automated SQL generation and adaptation to various heterogeneous databases, many extension frameworks and solutions are already in our minds.

Based on the analysis of the core code of SSM, this book breaks through the bottleneck of JavaWeb R&D, selects the easy-to-understand version of Spring.Spring MVC and MyBatis framework, deeply analyzes the implementation of each module, and digs out common design patterns from the code. Provides methodology and good practices for readers to understand the extensible design art of the Spring series framework.

The Spring Source Code Analysis of this book is based on Spring 4.3.2, which analyzes the implementation of Spring context, Spring AOP and Spring transactions, and demonstrates the concealment of framework traps and the necessity of learning framework principles through examples. The Spring MVC source code analysis article is based on the Spring MVC3.0 version. This version is relatively simple and has a clear core for readers to understand thoroughly. Here we mainly explain the design patterns and pluggable design ideas. The MyBatis source code analysis article is based on MyBatis 3.4 version, to help readers have a deeper understanding of SQL language, JDBC and data access methods, and can also see a large number of applications of design patterns such as factories, Builders, agents, and decorators in MyBatis.

In-depth analysis of Spring source code

Spring basic introduction

Spring is a layered open source framework used to simplify the development of enterprise-level Java applications. It has powerful expansion and integration capabilities. It is good at combining various single-layer frameworks perfectly and establishing a complete system that is unified and efficient Construct an application system that can provide enterprise-level services.

The advantages of Spring are mainly reflected in the following points:

Reduce the difficulty of using J2EE, and facilitate the integration of various frameworks.

Recommend and use a lot of object-oriented design ideas. It is a classic framework for learning Java source code.

Interface-oriented programming, rather than class-oriented programming, constantly uses Java's polymorphic features and good object-oriented design ideas to reduce the complexity and coupling of the program.

Provides a test framework and supports the integration of other test frameworks to make testing easier, and writing test programs simpler and more efficient.

Design and Implementation of Spring Loading Mechanism

The design and implementation of the Spring context was explained earlier. So how is the Spring context loaded? What is Sping: Does it achieve flexible extension? What does Spring do when it loads? Only understand these. We can better understand Spring's implementation details, so as to better control Spring's secondary development and extension.

Many well-known middleware are implemented by relying on the Spring context. Many enterprise applications also rely on Spring as the basis to build and implement, so understanding Spring loading mechanism is very important for the development of general middleware.

The editor is here to organize a study notes on the actual combat of Spring Cloud and Docker microservice architecture. If you need to receive it, please click me to receive it for free

Spring combat

In-depth analysis of SpringMVC source code

Introduction to MVC

From this chapter until Chapter 14, we will conduct a comprehensive analysis of Spring Web MVC's architecture principles and design ideas. Since source code analysis will explore many details of human code implementation, the process is complicated, so the code function is relatively simple and the main battle is more Clear Spring. 3.0 version to explain. Another advantage of choosing this version is that the main design ideas of Spring have been established in this version: this version. Subsequent versions did not make major changes to Spring's architecture. The analysis of this version can help us establish architectural thinking and also help us understand the ideas of reusable framework design.

Let's first analyze the classic MVC architecture. And by comparing the difference between MVC and WehMVC, to deeply understand the origin and characteristics of WebMVC.

Spring Web MVC workflow

Spring is a lightweight J2EE framework that can run on any web container. In fact. In the architecture of Spring's core component DispatcherServlet, the Serlet. Listener and Filter in the Web container specification have been implemented.

This chapter explains the implementation principle of Web MVC in Spring, by analyzing the various components of Spring Web MVC. Component interface, as well as the coordination and communication principle and process between various components, to explain the basic working principle of Spring Web MVC.

In-depth analysis of MyBatis source code

MyBatis introduction

MyBatis is a lightweight Java persistence layer middleware, which is completely based on JDBC to achieve persistent data access. Supports configuration in the form of XML and annotations. Can speak smartly. Simply perform SQL mapping. It also provides a richer result set than JDBC. The application can choose a result set that is more friendly to its own data.

As a middleware, how to link up

Java Databnse oneetivity (JDBC) API is an industry standard for mutual trust between Java and many SQL databases and other tabular data sources (such as spreadsheets or files). The JDBC API provides a call-level API for SQL-based database access.

Although MyBatis is positioned as SQL Mapping middleware. But in addition to providing a simple set of APIs for upper-level applications, it is also closely related to the underlying JDBC. Let me talk about how MyBatis and JDBC are related.

This concludes the article

 

Welfare sharing from the editor


SSM is a combination of Spring, Spring MVC and MyBatis framework. It is an open source web framework that is widely used and stable in the Java field. I will compile a study notes on the actual combat of Spring Cloud and Docker microservice architecture. You can click me to get it for free .

Guess you like

Origin blog.csdn.net/SQY0809/article/details/109393415