Let’s share the SSM integrated development actual documents compiled by many technical experts of Huawei and Alibaba over 15 years of development experience. It is said that the Git star is 19.8K+!

Preface

Since its birth in 2002, Spring has a history of nearly 20 years. Although it has undergone several changes, it has always continued to develop and improve. Spring is currently maintained and developed by Pivotal.

Pivotal is the leader of PaaS (Platform as a Service) and the creator of the messaging middleware RabbitMQ. Gemfire, the 12306 traffic peaking platform, is also the company's handwriting. In addition, it has a deep relationship with the well-known NoSQL database Redis.

Spring simplifies the development of application systems. IoC and AOP are its two core concepts. The IoC container is used to manage components and inject dependencies. AOP further reduces the coupling of modules and improves reusability and development efficiency. From the initial development of Java Web applications with Structs to the emergence and maturity of Spring MVC, Spring has always maintained good scalability and compatibility. In addition to the third-party libraries supported by default, other libraries are also easy to integrate with Spring, including MyBatis. Compared with Hibernate's fully automatic ORM framework, MyBatis is more flexible and flexible, and its performance is easier to improve.

This article starts from the actual combat, and on the basis of using the framework to develop, has made an in-depth discussion and presentation of the principle and implementation mechanism of the framework, so that the reader knows what it is and why it is. "The sergeant hears the truth and works diligently." The fastest way to learn technology is to conduct actual combat on the basis of understanding, and improve the mastery and understanding of the framework on the basis of actual combat, so as to realize the knowledge and use of the framework. Relevant to the goal of intensive use.

Because this article contains too much content, each chapter has more detailed content, so I can only show some of the knowledge points to give you an introduction, hoping to get everyone's understanding and love! !

table of Contents

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

main content

The first part of the Spring core framework (Chapters 1 to 6), this part first introduces the development history, system and ecology of the Spring framework, overlooking Spring from a macro perspective, and then introduces the core framework of Spring, including IoC. /DI concept analysis, container configuration and initialization, various ways of bean instantiation, bean configuration attributes, dependency injection and pre-dependency and circular dependency configuration, container extension points, etc. This article also introduces Java annotations, Spring container annotations and Java code configuration, and also introduces the Java testing framework and Spring testing framework.

Chapter 1 Overview of Spring;

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 2 A preliminary exploration of Spring loC container; IoC container is the core concept and content of Spring. It replaces the traditional new method of initializing objects. By reading the Bean definition configured in the XML file, it automatically creates and manages the container's Bean instance and its life cycle; the most important thing is that you can configure dependent objects in the Bean definition. , And automatically inject related dependencies according to the dependency configuration to reduce the degree of coupling between objects to achieve the effect of decoupling. Spring provides a variety of dependency injection methods, including constructor injection and setting value injection.

In order to better understand the concepts of Spring IoC, this chapter first briefly introduces the concepts of components, containers, frameworks and beans, inversion of control and dependency injection, and then introduces the core of the Spring container.

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 3 Web project environment construction and project creation; the most intuitive and fastest learning method for a development language or an application framework is to set up a good environment and write an introductory Hello World example. This chapter starts with setting up a development environment, then creates a Maven Web project (the project name is ssmi), then configures this Web project as a Spring framework-based project, performs preliminary container configuration, and finally demonstrates initialization with a simple example The container and the operation of getting Bean from the container.

The code examples in other chapters of this book are all included in the ssmi project, which is distinguished by chapter. The software tools mentioned in this chapter can be found in the supporting resources of this book.

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 4 Spring loC container advancement; this chapter, based on the preliminary introduction of Bean and dependency configuration in Chapter 2, will further introduce the various configuration methods of Bean instantiation to meet more Bean initialization scenarios. In addition to the id and class attributes, you can set more attributes of the Bean to define the characteristics and behavior of the Bean, including scope attributes (scope), lazy loading attributes (lazy-init), initialization and destruction methods (init-method, destroy- method) and so on.

In addition to the general Java object type, the dependency injection type of Bean can also be a simple type or a collection type. Injecting multiple dependencies into the same Bean, the matching rules and order can be specified. At the end of this chapter, we will introduce the extension points of the container and Bean, which are used to expand the functions of the Bean in different life cycles.

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 5 Configuration based on annotations and codes; using XML file configuration is the earliest configuration method in Spring. Large and medium-sized projects are split into multiple configuration files based on functions or different namespaces. Each configuration file may have more configuration content. , Resulting in heavy workload and error-prone maintenance of configuration files.

Starting from Spring 2.5, while using XML files as the main configuration, some configurations can be directly configured in the code in the way of annotations, which greatly reduces the cumbersomeness of configuration and improves the efficiency of configuration. Java developers are also more Easy to familiarize and adapt. Starting from Spring 3.0, it is possible to completely break away from XML files and use Java code to configure the container and framework.

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 6 Spring Test;

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

The second part of the Spring MVC framework (Chapters 7 to 10), this part first starts with HTTP and Java Web, and analyzes the technical details of Spring MVC, including the central controller, processor mapper, processor adapter and View parser, etc.; then on this basis, the configuration and annotation development of Spring MVC are introduced, and the type conversion, data binding, data verification and MVC exception handling of MVC projects are introduced. Finally, in the advanced part Introduced Spring parent-child container, REST style service, JSON format data return, and file upload.

Chapter 7 Overview of Spring Web MVC;

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 8 Data Type Conversion, Verification and Exception Handling;

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 9 Spring MVC Advanced;

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 10 Spring MVC testing framework;

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 3 Data Technology (Chapters 11 to 14). This article first introduces relational databases, MySQL and Java data access technology, ORM framework, JPA unified interface, etc., and then focuses on the MyBatis core interface, XML global configuration and Mapping configuration, and introduced the internal operation of MyBatis, dynamic SQL, caching, SQL constructor and annotation-based development methods. In addition, this article also introduces Spring's data access technology, including Spring JDBC template classes, Spring DAO, Spring integration ORM and JPA, Spring transaction management, etc.

Chapter 11 Database and Java Data Access Technology;

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 12 Introduction to MyBatis;

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 13 MyBatis Advanced;

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 14 Spring data access and transaction management;

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

The fourth SSM integrated development (Chapter 15, 16), this article first introduced Spring and Spring MVC, and Spring and MyBatis integrated development related content, and analyzed the integration of exception handling and logging, and then a The report project is a case, which comprehensively introduces the entire process of the project's requirements analysis, system analysis, system design, system framework construction and code development.

Chapter 15 Overview of SSM Integration;

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 16 SSM integration examples;

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

The fifth chapter of advanced development technology (Chapter 17, 18), this chapter mainly introduces the Spring AOP framework and Spring Security framework. First, analyze Spring AOP based on the introduction of Java proxy and AspectJ framework, and compare the interceptors and filters in the MVC project; then the user authentication and authorization of SpringSecurity user request and call method two levels The development is introduced, and the related content of multithreading and its application in the Spring framework are introduced.

Chapter 17 Spring AOP and MVC interceptor; AOP is another important programming idea after OOP. As a supplement and extension of OOP, it further improves code reuse and development efficiency. In Java, through the proxy design pattern and dynamic proxy technology, AOP can be implemented in code structure and code function respectively.

In addition to the AOP technology of the JDK itself, there are also mature third-party AOP frameworks in the Java field, such as AspectJ, AspectWerkz, and Javassist, among which AspectJ is the most mature and complete Java AOP framework. Spring implements its own AOP framework based on JDK dynamic proxy and CGLIB. It draws on AspectJ to a large extent in terms of framework design and syntax, and provides AOP annotations similar to AspectJ.

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

Chapter 18 Spring Security framework and multithreading; permission code mixed in business logic code will cause business code redundancy, confusion, and error-prone. Spring Security is a security framework provided by Spring. It can realize the use of filters to protect the resource level without affecting the original business logic code, and the use of Spring AOP to achieve method-level access control. This chapter mainly introduces the content and usage of the Spring Security framework, and also briefly introduces Java multithreading and its application in Spring.

Summary of 15-year development experience of technical experts such as Huawei and Ali: SSM integrated development actual document

 

This [Spring+Spring MVC+MyBatis Integrated Development Practical Combat] has a total of 1014 pages, because the content of the article cannot show you more content, friends who need the full version, can forward this article to follow the editor, scan the code to get it! !

Features of this article

1. From simple to complex, from the shallower to the deeper

This article organizes chapters according to the logical sequence of Spring, Spring MVC, MyBatis and SSM integration, starting with simple examples of the knowledge points in the book, and then launching a detailed introduction and decryption of the internal mechanism.

2. Give simple, detailed and detailed sample codes to facilitate readers to quickly learn and understand

This article is based on actual combat. The knowledge points of each chapter in the book are equipped with simple examples, which can assist readers in getting started and understanding quickly. The sample codes in this article correspond to the chapters one by one, which is convenient for readers to learn and consult.

3. Comprehensive coverage of Java Web development technology, and an introduction to Java underlying technology and other mainstream libraries and frameworks

This article mainly introduces Spring, Spring MVC and MyBatis and their integration.

In addition, this article also introduces Java Web related technologies and frameworks, including Java annotations, unit testing (JUnit and TestNG), Java reflection and proxy, Java multithreading and ThreadLocal, HTTP, Servlet, REST and mainstream JSON libraries ( Json-lib, Gson, Fastjson and Jackson), Commons FileUpload, database connection pool (C3P0, DBCP2), Spring and Hibernate integration, Spring and JPA integration, etc.

4. Pay attention to the analysis of principles and mechanisms, and show them through simple logical illustrations

This article focuses on the decryption of the internal implementation mechanism and principles of the framework, including the technical details of DispatcherServlet, the operation principle of MyBatis, the implementation mechanism of AOP, and the decryption of Spring Security. For these contents, the author simplifies and presents them through logical diagrams or flowcharts, which is convenient for readers to understand more intuitively.

5. Typical project cases, strong practicality, can be used as a template for actual projects

This article introduces an example of a project derived from actual needs. Starting from the needs analysis, it fully presents the analysis, design, architecture, and development process of the entire project. The project architecture can be used as a template for the SSM architecture, and projects of the same type can continue to be developed on top of this.

Guess you like

Origin blog.csdn.net/bjmashibing001/article/details/109826852