Introduction to the SSM Framework

Introduction to the SSM framework
(1) Spring: Reduce coupling relationships, easy to develop and implement: Spring can be used as a large Factory, and the creation of objects and the integration of related dependencies are handed over to the spring container to solve. Introducing the AOP framework: Spring provides aspect-oriented programming, which to a large extent solves the problems of authority management and transaction management in the project. Accept declarative transactions: greatly reduce code writing, and only through simple configuration file writing, transactions can be managed. Highly integrated project testing: Introduce junit dependency in spring, and through annotations, various unit and integration tests can be completed in real time. Convenient integration of various excellent frameworks: As an excellent framework, spring fully supports other excellent frameworks, such as mybatis. Simplify the call of javaEE API: Spring has re-encapsulated the java EE API, which can make it more convenient for developers to call.
(2) SpringMVC: The function of SpringMVC is to intercept user requests. The core Servlet, DispatcherServlet, plays a front-end or relay role, passing the required request through HandlerMapping to the relevant Controller. The Controller actually implements the relevant request. The specific operation completed.
(3) mybatis: The traditional jdbc is quite cumbersome to use. It is necessary to connect to the database through a special sql object. The sql statement is mixed in the Java code, and the code looks very redundant. The emergence of mybatis has just changed this situation. , Mybatis is based on jdbc encapsulation, which enables programmers to separate the development of business logic from the writing of sql statements for operating the database. The sqlSessionFactory instance is the core of mybatis, and the operations of mybatis are all based on this. My-batis only forms the association of tables in the database with entity classes by writing the Mapper configuration file in the resource directory. In the Mapper file, more attention is paid to the operation of the database, that is, the writing of sql statements, which allows developers to write more optimized sql, to improve database performance. Every time you interact with the database, you need to get an instance of sqlSession through the sqlSessionFactory factory, and then execute the sql command.
The page sends a request to the Controller. The Controller calls the Serve layer to process business logic. The logic layer sends a request to the Dao layer. The Dao layer interacts with the database and then returns the result to the Serve layer. The Serve layer sends the processing logic to the Con- troller, and then the Controller calls it. The view displays relevant data.

Guess you like

Origin blog.csdn.net/qq_42918433/article/details/113822339