[Interview preparation] Spring, SpringMVC, Struts2, MyBatis, Hibernate advantages and disadvantages

Advantages and disadvantages: Spring, SpringMVC, Struts2, MyBatis, Hibernate

Caused his interview preparation questions, add your own and integrate other people sharing!

1. Spring's strengths and weaknesses

Advantages:
low-intrusive design
2 independent of the various application servers
3 dependency injection on the transparent component relationships, reduced coupling
characteristic for section 4 allows to centralize common tasks
5 and the integration of third party frameworks good

Disadvantages:
1 jsp in to write a lot of code, the controller is too flexible, the lack of a common controller
one of 2 Spring does not support distributed, which is still in use EJB reasons

2. SpringMVC advantages and disadvantages

Advantages:
1 clear role division
two flexible configuration function
3 provides a number of interface and implementation class controller
4 and to achieve truly independent View layer
5 internationalization support
6 oriented programming interface

Disadvantages:
1 and the Spring coupling Servlet MVC API, it is difficult to run independently from the container
2 too broken down, low development efficiency
3 excessive pursuit of perfection, there is the danger of over-design

3. Struts2 advantages and disadvantages of

Advantages:
1 to achieve the MVC pattern, clear hierarchy, so that programmers can focus on business logic implementation.
2 rich tag library, greatly improving the efficiency of development.
3 Struts2 provides a wealth of interceptors to achieve.
4 through the configuration file, you can grasp the relationship between the various parts of the entire system.
5 exception handling mechanism, you need to configure an exception mapping in the configuration file, an exception can be made for appropriate treatment.
Scalability 6 Struts2 high.
7 Oriented Programming ideas in Strut2 also been well represented.

Disadvantages:
1 parity still feel relatively cumbersome.
2 security needs to be improved.

4. MyBatis advantages and disadvantages

Advantages:
1 compared with JDBC, reducing the amount of code more than 50%.
2 MyBatis is the easiest persistence framework, compact and easy to learn.
3 MyBatis flexible, does not impose any impact on the existing application or database design, SQL written in XML, complete separation from the program code, reduce the degree of coupling, to facilitate unified management and optimization, reusable.
4 provides XML tags, support the preparation of dynamic SQL statements (XML used if, else).
5 provides a mapping label, field support ORM object-relational mapping database (configuration mapping in XML, you can also use comment)

Disadvantages:
write workload 1 SQL statement is large, especially in multi-fields, the associated table for a long time, even more so, to write SQL statements to developer skills have certain requirements.
2 SQL statement depends on the database, resulting in poor portability database, the database can not be replaced.

5. Hibernate advantages and disadvantages

Advantages:
one pair of codes JDBC database access made package, simplifies the data access layer tedious repetitive coding
flexibility in mapping 2, which supports a variety of relational databases, the many-to-one complex relationships of
3 non-invasive, good portability
4 caching mechanisms to provide a cache and secondary cache

Disadvantages:
1 can not be optimized for SQL
2 ORM framework in the use of the principle causes the configuration is too complex
3 and efficiency compared to native JDBC deviation:, especially when the bulk data processing
4 does not support batch modify, delete

Guess you like

Origin blog.csdn.net/weixin_43266090/article/details/89479294