SpringMVC workflow? Mybatis and hibernate difference?

SpringMVC workflow?
1. The user sends a request to the front end of the controller the DispatcherServlet
2. HandlerMapping the DispatcherServlet call processor receives the request mapper.
3. Processor mapper find specific processor upon request url, the object generation processor and a processor blocker (if any is generated) together back to DispatcherServlet.
4. DispatcherServlet HandlerAdapter call processor through the processor adapter
5. The execution processor (Controller, also called back-end).
6. Controller completed execution returns ModelAndView
7. The ModelAndView HandlerAdapter is the execution result back to the controller the DispatcherServlet
8. The ModelAndView will pass the DispatcherServlet ViewReslover view resolver
9. ViewReslover returns parsed DETAILED View
10. The View render the view of the DispatcherServlet (filling about to model data to view).
In response to user 11. DispatcherServlet

 

1. Mybatis and hibernate different, it is not exactly an ORM framework, because MyBatis require programmers to write their own Sql statement, but mybatis can be flexibly configured to run sql statement by way of XML or annotation, and java objects and mapping generated sql statement sql executed last, the final results will then map generation performed sql java object.

2. Mybatis learning threshold is low, easy to learn, programmers write directly to the original ecology sql, sql execution performance can be strictly controlled, high flexibility, ideal for less demanding on the relational data model of software development, such as Internet software, enterprise class operating software etc., because such software requirements change frequently, but the needs of a rapid change in output required outcomes. But that flexibility can not be done on the premise that mybatis database-independent, supports multiple databases need to implement if the software you need to customize sets of sql mapping file, the heavy workload.

3. Hibernate object / relational mapping capabilities strong, independent of the database is good for high-relational model requires software (such as fixed demand customized software) if hibernate developers can save a lot of code and improve efficiency. But learning Hibernate high threshold, higher threshold to master, and how design O / R mapping, how to balance between performance and object model, and how to make good use of Hibernate need to have strong experience and ability to the job.
4. In summary, in accordance with the needs of users in resource-limited settings can be made as long as maintenance, scalability good software architecture is good architecture, it is only suitable framework is the best.

Guess you like

Origin www.cnblogs.com/DSC1991/p/11910676.html