Java SSH Workflow

Source: Internet
Author: User

SSH workflow:

JSP pages send requests, Struts receives page requests, Struts actions call business logic, and business logic call business components (use spring dependencies to inject IOC, or AOP ); the business component queries the database based on the ing relationship of the Object/Relational Database of hibernate. Struts returns the page based on the result.


systems integrated with the SSH framework are divided into four layers: presentation layer, business logic layer, data persistence layer, and domain Module layer, to help developers build a Program with clear structures, good reusability, and convenient maintenance in a short period of time. Struts is used as the overall infrastructure of the system and is responsible for the separation of MVC. In the model section of the Struts framework, business redirection is controlled, and the persistence layer is supported by the Hibernate framework. Spring is used for management, manage struts and hibernate. The specific method is to use the Object-Oriented Analysis Method to propose some models as needed, implement these models as basic Java objects, and then write the basic Dao (Data
access objects) interface, and provides the DAO implementation of hibernate. The DAO class implemented by the hibernate architecture is used to implement conversion and access between Java classes and databases. At last, spring manages and manages struts and hibernate. The basic business flow of the system is: in the presentation layer, the interactive interface is implemented through the JSP page, which is responsible for transmitting requests and receiving responses ), then struts delegates the request received by the actionservlet to the corresponding action based on the configuration file. In the business layer, the Spring IoC container that manages service components is responsible for providing the business model component to the action and the collaborative Object Data Processing (DAO) component of the component to complete the business logic, it also provides container components such as transaction processing and buffer pool to improve system performance and ensure data integrity. In the persistence layer, Hibernate's object-oriented ing and database interaction are used to process the data requested by the DaO component and return the processing result. The above development model not only achieves the complete separation of views, controllers and models, but also achieves the separation of the business logic layer and the persistent layer. In this way, no matter how the front-end changes, the model layer requires only a few changes, and database changes do not affect the front-end, greatly improving the reusability of the system. In addition, because the coupling between different layers is small, it is beneficial for team members to work in parallel and greatly improves the development efficiency.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.