Some suggestions for beginners to learn the three frameworks of SSH

Speaking of the three major frameworks, SSM is currently commonly used. Some people think that the SSH framework has fallen behind and has been eliminated. In fact, this is not entirely true. After all, it implements the basic functions of the classic MVC framework and will be used in some projects. Because it is not used much, there will be many problems. At the same time, SSH is often used in teaching. The author thinks that the significance of SSH in teaching is to help learners understand the principles of the classic MVC framework. Let's briefly talk about how to learn SSH as a novice.
The so-called SSH expansion includes three parts: struts, spring, and hibernate. The learning sequence can also be done in this order. As a classic MVC framework, it naturally includes the view layer (V), business control layer (C) and persistence layer (M). V corresponds to struts, C corresponds to spring, and M corresponds to hibernate. This is probably the relationship between the three parts. A brief description in the order of study is as follows:

First, the Struts framework
In the above introduction, we learned that the task of Struts lies in the view layer, and its greatest role is to distinguish the view from the business logic, which makes the entire framework clear and organized for easy reading and operation. In the process of in-depth Struts, it is necessary to clarify the role of javabean in it, that is, to encapsulate the underlying business logic. On this basis, ActionForm can encapsulate request parameters to process requests from users. Struts is also an object-oriented design, which improves the efficiency of developing the web.

2. The existence of Spring framework
Spring makes the instantiated beans managed by the container. In Spring, the common containers are IOC (inversion of control) and AOP (aspect-oriented programming). At the same time, this is also a feature of Spring, which makes the programming mode Unlike in the past, the coupling of classes in the project is reduced. Like Struts, Spring's basic architecture is also built on javabeans, which is most directly reflected in the IOC container. In this way, we will let Spring control the dependencies between different objects, thereby reducing the high coupling generated in the coding process. Regarding the content of AOP, I will not repeat it here. Whether it is IOC or AOP, they both provide means for database operations. The JDBC that comes with Spring can easily and effectively manage data and avoid some unnecessary errors. In the SSM framework, Spring also plays the same role, so it is recommended that students take this part as a learning point.

Third, the Hibernate framework
On the basis of Struts and Spring, you can learn Hibernate in depth. The operation of the database often requires the input of cumbersome SQL statements, which is less efficient when doing large-scale projects. Hibernate is an open source object-relational mapping (orm-mapping) framework, which can not only persist data in the database, but also reversely map the tables in the database to entity objects, so as to avoid the labor of writing SQL, and thus improve the performance of the database. Operation is more convenient. To learn the Hibernate framework, you must be familiar with various mapping relationships, combine specific projects and connect to the database for operation.
Familiar with the persistence of data objects should also understand that Hibernate can perform transaction control. These functions require five common interfaces: Session, SessionFactory, Transaction, Query and Configuration. The role of Session is to persist objects. SessionFactory is the factory mode of Session. One database can be specified, unless multiple databases need to be operated at the same time. The remaining three interfaces will not be discussed here, and it is recommended that beginners should focus on grasping them. What needs to be reminded here is that Hibernate is not suitable for batch modification and deletion of databases, which may be the drawback of Hibernate applications today.

Whether SSH or SSM is an important part of JavaEE, it contains many components and various configurations, and they are interdependent and related to each other. To fully master it is not an overnight thing. In addition to finding information, asking teachers and colleagues for advice, but also trying more on your own, so as to continuously accumulate experience.
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325984272&siteId=291194637