I chose the SSH framework.
Reasons for the selection:
The SSH framework is an integrated framework for struts+spring+hibernate, which is a popular open-source framework for Web applications.
Struts:
Pros: First of all, he is open source, enabling developers to learn more about his principles and internal implementation mechanisms, extensibility
Using MVC mode to separate business logic Layer display Layer model layer low coupling, structure clear, so that developers focus on business logic
There are also a wealth of tag libraries for use
Support Internationalization
And very high reusability.
Hibernate
Advantage: He is a database-connected middleware, and the dependencies on the program are small transparency uses the reflection mechanism of Java
Lightweight he has a lightweight encapsulation of JDBC and can replace the EJB CMP in the program to complete the persistence
Very good performance, but also lightweight and flexible
He supports 1-to-many complex relationships across multiple databases
Can be programmed entirely using object-oriented thinking
JTA JDBC and Jndi techniques are used
Spring
Pros: Spring is a framework based on the IOC (inversion of Control) and AOP (tangent-oriented programming)
and encapsulates all of the transactions, without requiring the programmer to commit the transaction themselves, everything is controlled by the Web container, eliminating a lot of code
Spring adopts the Java program in the MVC mode using the single and factory modes Although the relationship between layers and layers has been reduced, there is still a connection, at this time using spring to put all the beans to the Web container to control Created and destroyed so that the coupling is really reduced, and the lifetime of the Bean's creation is controlled in the Web container, and the bean that he has from the factory instance is single-state, and of course you can add a property to make it not a single state.
Interface-oriented programming, only need to know the interface to implement can, do not need to know his specific implementation
Using the Spring framework facilitates unit testing
Description of the SSH framework:
The system of the integrated SSH framework is divided into four layers: presentation layer, business logic layer, data persistence layer and Domain module layer to help developers build clear, reusable and easy-to-maintain web applications in a short period of time. It uses struts as the overall infrastructure of the system, is responsible for the separation of MVC, controls the business jump in the model part of the Struts framework, supports the persistence layer with the Hibernate framework, manages the spring, manages struts and hibernate. By using object-oriented analysis method, we propose some models, implement these models as basic Java objects, and then write the basic DAO (Data Access Objects) interface, and give the DAO implementation of Hibernate. The DAO class implemented by the hibernate architecture implements conversion and access between Java classes and databases, and finally manages struts and hibernate with spring.
The basic business process of the system is: in the presentation layer, first through the JSP page implementation interface, responsible for receiving requests and delivery response (Response), and then struts according to the configuration file (Struts-config.xml) Delegate the request received by Actionservlet to the appropriate action handler. In the business layer, the spring IOC container that manages the serviced component is responsible for delivering the business model component to the action and the component's collaboration Object data Processing (DAO) component to complete the business logic and to provide container components such as transaction processing, buffer pooling to improve system performance and ensure data integrity. In the persistence layer, it relies on Hibernate's object mapping and database interaction, processing the data requested by the DAO component, and returning the processing results. The above development model not only realizes the complete separation of the view, controller and model, but also realizes the separation of the business logic layer and the persistence layer. This way, no matter how the front-end changes, the model layer requires little change, and the database changes will not affect the front end, greatly improving the reusability of the system. And because of the small coupling between different layers, it is advantageous to the team members to work in parallel, greatly improving the development efficiency.
The reason of choosing software architecture