Recently in the Learning Ssm+redis framework, so today based on the knowledge learned this semester to make a summary of the framework, first of all a concept.
In the Java Internet, with Spring+springmvc+mybatis (SSM) as the mainstream framework, the structure of the Ssm+redis is as follows:
Here's a brief description of the functions they assume.
1. Spring IoC (inversion of control, inversion of controls) undertakes a resource management, integration, plug-and-pull function. For example, in Java we design two kinds of interfaces for the state socket, so we can new two for two sockets, but if you want to change thousands of such sockets, do you want to new many objects, so do not create the object in new way, but use the configuration method, and then use the configuration, Then let the spring IOC container itself go through the configuration to find the socket.
2, Spring AOP (Aspect oriented programming, aspect-oriented programming), especially in database management. What is the difference between this object-oriented and aspect-oriented facet? Object-oriented to face a specific thing, such as an order system inside the order, Production department, Finance Department 3 OPP objects. If an exception occurs, you need to roll back things for each of the three objects. Facing the three objects, it will roll back the things in the database to ensure the consistency of the data.
3, SPRINGMVC includes model (model), view (view), Controller (Controller), where the model is responsible for encapsulating the application data and the pojo generated by him; The view is responsible for rendering the data to the view and presenting the data to the user in a certain form. The controller is responsible for processing the user request and establishing the appropriate model to pass it to the view rendering.
4, MyBatis provides a database access to the persistence layer, through the Mybatis-spring project, it can and spring seamless docking.
5, Hibernate is also a persistent layer, that is, ssh in the H, why the SSH was the SSM replaced the reasons, especially hibernate was MyBatis replaced. First of all, we must start from the difference between them, hibernate basically do not need to write SQL statements, but through mapping relationships to manipulate the database, is a map of the whole table, and MyBatis is different, it needs to provide SQL to run through us. In the past management system era, first to complete the business functions, and then pay attention to performance, and shielding the SQL hibernate more suitable for development. But in the Internet age, performance is required, and mybatis can overcome hibernate cascading performance loss due to more than three multiple table associations. Therefore, the performance requirements of the system is not too harsh, as the management system and ERP recommended hibernate, while for performance requirements, fast response, flexible systems recommend the use of MyBatis.
6, Redis as the most popular nosql (not associated with the database), it provides the ability to process data and cache data at a high speed, making most of the system only need to cache pages, without having to read and write from the database disk; In some situations where you need to tell the operation, you can also use it to complete the operation. Then, the data are stored in the database in batches, which can greatly improve the performance and responsiveness of the Internet system. But I think it is impossible to completely replace the database, because the database system has better normative and data integrity, security is higher.
Follow-up will release more records of learning, such as the basics of machine learning, reptiles, financial risk analysis, and even some of the operating system and database aspects of the curriculum challenges.