[Interview preparation] Spring, SpringMVC, Struts2, MyBatis, Hibernate works

Works: Spring, SpringMVC, Struts2, MyBatis, Hibernate

Caused his interview preparation questions, add your own and integrate others to share, some may flow!

1. Spring's works

Spring is a container frame of the IOC and AOP, IOC (inversion control), the steering control of the vessel by the object itself, to create an instance of a configuration file to the container and create dependencies between the various instances. The AOP (Aspect Oriented Programming), and the common logic behavior encapsulated into a section, to reduce the duplication of code systems, to reduce the coupling between modules, can add functionality without changing the source code.

2. SpringMVC works

title
The user sends a request to the front-end controller, the front end processor controller delegation request to the background, the background processor invokes the business object model layer returns to the background model data processor, the processor returns back to the front controller ModelAndView a view, front controller rendered and control returns generated in response to the user.

3. Struts2 works of

A client sends a request
2 through a series of filters
3 FilterDispatcher is invoked, FilterDispatcher Action asked to decide which calls ActionMapper
4 If ActionMapper decide which calls Action, FilterDispatcher the request to the ActionProxy
. 5 Action to call according to the ActionProxy profile
6 ActionProxy Creating ActionInvocation instance
after 7 Action call is completed, ActionInvocation to return results based on corresponding configuration file

4. MyBatis works

1 Load mybatis profile
2 to create a SqlSessionFactory
. 3 SqlSession created
. 4 Transaction Control
5 calls the interface method Mapper
6 is closed SqlSession

5. Hibernate works

Load Profile 1
2 Load map file
3 SessionFactory created
. 4 creates the Session
. 5 Open Services
6 persistence operations
7 commit the transaction
8 closes the Session
. 9 Close SessionFactory

Guess you like

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