Common advantages and disadvantages of java development framework

A, Struts2 is based on the MVC design pattern of a Web application framework in the MVC design pattern, Struts2 as a controller (Controller) to establish interaction model with a data view.
Struts2 advantage
1, to achieve the MVC pattern, a clear hierarchy.
2, has a rich tag library, greatly improve the efficiency of development.
3, using the OGNL: OGNL data can quickly access the value stack, the value of the method call stack object.
4, provides a wealth of interceptors.
5, Struts2 multiple view options (JSP, Velocity, etc.) to support.

Two, Hibernate is an ORM framework, to establish some mapping between Java objects and relational databases, in order to achieve direct access Java objects
advantages and disadvantages of Hibernate
advantages:
1, improve production efficiency
2, more portable, for different databases, developers need only use the same data to operate.
3, the flexibility of mapping, it can support a variety of relational databases, complex relationships from one to many to many to many.
4, there is provided a cache (Session) and secondary cache (SessionFactory).
Disadvantages:
1, due to the persistence layer too complete package, developers can not lead to SQL optimization.
2, ORM principles of the project, resulting in overly complicated configuration.
3, the efficiency and the deviation compared to native JDBC: especially when a batch of data processing.
4, does not support batch delete, modify.

How to Hibernate lazy loading (lazy loading)
1, when the call load session () method to load the entity class, it will delay loading.
2, when an entity Session loading, this will set the value of the entity attribute using lazy loading.

Three, Spring is an open source design level framework, which addresses the business logic layer and the other layers are loosely coupled problem of
Spring and what is the advantage of Spring
1, Spring is a lightweight container frame IOC and AOP.
2, supports the statement of things.
3, Spring is a container because it contains and manages the lifecycle and configuration of application objects, such as creating objects, destruction, callback and so on.
4, reduce the difficulty of Java EE API.
5, Spring provides direct support for a variety of excellent frameworks (such as Struts, Hibernate, etc.) and the like.

Spring's injection method which
Spring There are three main injection method: making injection method, setter injection, interface injection.

Four, SpringMVC is based on Java, realized the Web MVC design pattern, request-driven type of lightweight Web framework that uses the MVC architectural pattern of thinking, the Web layer to decouple duties.
springmvc how to prevent SQL injection
use interceptors to achieve SpringMVC prevent SQL injection.

Five, MyBatis is an excellent persistence framework that supports custom SQL, stored procedures and advanced mappings.
Talk about caching mechanism mybatis of
Mybatis caching mechanism there are two levels:
first-level cache (SqlSession level): a cache mybatsi almost automatically open for us, we do not have the manual operation, and we are not closed! ! But we can manually clear the cache.
Secondary cache: mapper-level cache, also based hashmap local cache, two different sqlSession execute sql statements in the same namespace, the second query the database will not (secondary cache we need to manually open).

What is the difference with the SSM SSH
SSH refers to: the Spring + Struts + Hibernate
SSM refers: Spring + SpringMVC + MyBatis

Hibernate differs Mybatis
. 1, a semi-automatic MyBatis, sql done manually, somewhat cumbersome.
2, hibernate high barriers to entry, the program does not need to write sql, sql statement is automatically generated. To optimize the sql statements modify more difficult.

Springmvc the difference struts2
1, is based on a core Struts2 Filter.
2, is based on a core SpringMvc the Servlet (front controller).
3, Struts2 OGNL expression of the page development efficiency compared SpringMVC higher.
4, SpringMVC simple to use, develop efficient than Struts2, support JSR303, easy to handle ajax requests.
---------------------
Author: weixin_42044993
Source: CSDN
Original: https: //blog.csdn.net/weixin_42044993/article/details/86532361
Disclaimer: This article as a blogger original article, reproduced, please attach Bowen link!

Guess you like

Origin www.cnblogs.com/cjeandailynotes/p/11109182.html