Basic concepts of SSM framework (what is ssm framework?)

Introduction

to SSM Framework SSM framework is the abbreviation of Spring + Spring MVC + MyBatis. This is the current mainstream Java EE enterprise-level framework after SSH, which is suitable for building various large-scale enterprise-level application systems.

1. Introduction to

        Spring Spring is an open source framework. Spring is a lightweight Java development framework that emerged in 2003. It is derived from some of the concepts and prototypes described by Rod Johnson in his book Expert One-On-One J2EE Development and Design. come. It was created to address the complexities of enterprise application development. Spring uses basic JavaBeans to do things that were previously only possible with EJBs. However, Spring's uses are not limited to server-side development. Any Java application can benefit from Spring in terms of simplicity, testability, and loose coupling. Simply put, Spring is a lightweight Inversion of Control (IoC) and Aspect Oriented (AOP) container framework.

      A. What is Inversion of Control (IOC)?
        IOC: Inversion of Control is also called Dependency Injection. Using the factory pattern to hand over the object to the container management, you only need to configure the corresponding bean in the spring configuration file, and set the relevant properties, so that the spring container can generate the instance object of the class and the management object. When the spring container starts, spring will initialize all the beans you configured in the configuration file, and then when you need to call it, it will assign those beans that have already been initialized to the classes you need to call these beans (assuming The class name is A), and the method of assignment is to call the setter method of A to inject, without requiring you to new these beans in A.
        [Note]: During the interview, if you have the conditions, draw a picture, which makes it even more obvious that you understand
      B. What is Aspect Oriented (AOP)?
        First of all, it should be noted that AOP is only a feature of Spring. It is a programming idea like OOP, not a certain technology. AOP can be said to be a supplement and improvement to OOP. OOP introduces concepts such as encapsulation, inheritance, and polymorphism to establish an object hierarchy that simulates a collection of common behaviors. When we need to introduce common behavior for distributed objects, OOP is powerless. That is, OOP allows you to define top-to-bottom relationships, but is not suitable for defining left-to-right relationships. For example the log function. Logging code tends to be spread horizontally across all object hierarchies, irrespective of the core functionality of the objects to which it spreads. In OOP design, it leads to a lot of code duplication, which is not conducive to the reuse of individual modules. Encapsulate the cross business logic (such as security, logging, transaction, etc.) in the program into an aspect, and then inject it into the target object (specific business logic).
        The technologies for implementing AOP are mainly divided into two categories: one is to use dynamic proxy technology, which uses the method of intercepting the message to decorate the message to replace the execution of the original object behavior; the other is to use the static weaving method to introduce A specific syntax creates "aspects" that allow the compiler to weave code about "aspects" during compilation.
[Simple explanation], for example, you want to add a function that prints 'Hello, AOP' to all classes in your biz layer. You can do it with aop thinking. You first write a class and write a method, After the method is implemented, print 'Hello, AOP' to let you Ioc this class ref="biz.*" to inject each class.

2. Introduction

        to Spring MVC Spring MVC is a follow-up product of Spring Framework and has been integrated into Spring Web Flow. Its natively supported Spring features make development very simple and standardized. Spring MVC separates the roles of controller, model object, dispatcher, and handler object, which makes them easier to customize.
3. Introduction to MyBatis

        MyBatis is an open source project of apache, iBatis. In 2010, this project was migrated from apache software foundation to google code and renamed MyBatis. MyBatis is a Java-based persistence layer framework. The persistence layer framework provided by iBATIS includes SQL Maps and Data Access Objects (DAO). MyBatis eliminates almost all JDBC code and manual setting of parameters and retrieval of result sets. MyBatis uses simple XML or annotations for configuration and primitive mapping, mapping interfaces and Java POJOs (Plain Old Java Objects, ordinary Java objects) to records in the database. It can be understood that MyBatis is a framework used to help you manage data addition, deletion, modification and query.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326484698&siteId=291194637