"SSM framework of the principles and comparisons with SSH framework of the" paper notes

"SSM framework of the principles and comparisons with SSH framework of the" paper notes

First, the basic information

  • Title: SSM framework of the principles and framework compared with SSH

  • Source: College of Engineering, Chongqing, Chongqing Banan District Nanquan Baihelin. 16 400 056

  • Keywords: spring, Mybatis, ssh framework

    Second, research

  1. SSM framework MVC standard mode, the whole system is divided into layers view, Controller level, service level, the DAO four layers.
    • DAO layer: DAO layer is mainly done work data persistence layer, is responsible for some liaison tasks with the database package in this design DAO layer is first designed DAO interface and define the implementation of this interface in the Spring configuration file class, then you can call this interface module for data processing services, without concern for this particular interface implementation class is which class, it is very clear structure, data source configuration DAO layer, and the parameters are related to the database connection a Spring configuration file.
    • Service Layer: Service layer is responsible for application design business logic module. First design of the interface, and then its implementation class design, followed by the configuration of its associated implementation in the Spring configuration file. So that we can call the Service interface applications to business processes. Business Service layer implementation to be called to the specific business logic DAO layer interface, the encapsulation Service layer defined in favor of the independence of the common business logic and reusability, the program is very simple.
    • Controller Layer: Controller layer is responsible for controlling specific business modules process, in which this layer is to call interface Service layer to control business processes, control configuration is also carried out in the Spring configuration file which, for specific business processes, will there are different controllers, the specific design process flow proceeds abstract induction may be designed flow module may subunit reused, so that not only the structure of the program becomes clear, also greatly reduces the amount of code.
    • View layer: This layer was combined with the control layer more closely, it is necessary to work together a combination of both. View layer is mainly responsible for representation reception jsp page.
  2. SSH framework Struct + Spring + Hibernate, SSH usually do Struts2 controller (controller), the component management layers spring, hibernate responsible for the persistence layer.
    • Spring-MVC Struct and are responsible for forwarding taken, but the request for both the above request great difference, is performed Struct a request for an Action class, i.e. an Action class corresponds to a request, the interception type, the request class data sharing. And Spring-MVC method is directed to the request level, that is, a method corresponding to a request, are intercepting method, a method of requesting data is not shared.
    • Spring-MVC profile remained relatively small, easy to use, can speed up software development.
    • Spring-MVC Servlet entrance is level and the level is Struct Filter level.
  3. For Hibernate and MyBitas operate on persistent classes, the difference between them is as follows:
    • Hibernate is an O / R-type relationship, to complete the mapping between database tables and persistent classes, and SQL-Maping MyBitas is directed, Hibernate to the database after the package is good, the appropriate database operations can be called HQL statement, and MyBitas the original database operation statement is used.
    • Based on a reason, then Hibernate optimization is relatively MyBitas difficult.
    • MyBitas entry faster, and Hibernate is relatively difficult to master.
    • For advanced queries, Mybatis need to manually write SQL statements, and ResultMap. Hibernate mapping and have a good mechanism, developers do not need to care about SQL generation and map the results, you can focus more on business processes.
    • Hibernate database is very portable, MyBatis database portability is not good, different databases need to write a different SQL.

      CONCLUSIONS

  • Comparison of the two is more than SSh SSM structure appropriate to the current development needs, develop more quickly and easily.

IV References

  • [1] Principle Huangling .SSM Comparative frame and a frame SSH [J] win the future, 2018,000 (016): P.455-455.

Guess you like

Origin www.cnblogs.com/clamye/p/12045458.html