2022年SSh架构详解 .pdf
《2022年SSh架构详解 .pdf》由会员分享,可在线阅读,更多相关《2022年SSh架构详解 .pdf(16页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、catalogAbstract . 2 1 Introduction . 2 2 Hierarchical Web Mechanism . 3 3 Lightweight Web Application Framework . 3 4 Struts MVC Framework . 5 4.1 Struts work mechanism . 5 4.2 Views. 6 4.3 Controller . 6 4.4 Model . 6 5 Spring Framework technology . 7 5.1 Spring Framework . 8 5.2 mechanism . 9 6 Hi
2、bernate Persistent Framework . 9 7 Framework Application Analysis . 11 8 Conclusion . 12 Acknowledgments. 13 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 16 页 - - - - - - - - - Application of the Lightweight J2EE Framework Based on SSH Abstract The applicatio
3、n system features in small or medium-sized enterprise lie in the greater flexibility and safety high performance-price ratio. Traditional J2EE framework can not adapt to these needs, but the system application based on SSH(Struts+Spring+Hibernate) technology can better satisfy such needs. This paper
4、 analyses some integration theory and key technologies about SSH, and according to the integration constructs a lightweight WEB framework, which has integrated the three kinds of technology ,forming the lightweight WEB framework based on SSH and gaining good effects in practical applications. Keywor
5、ds:lightweight, web framework, J2EE, Struts, Spring, Hibernate 1 Introduction Generally the J2EE platform27used in large enterprise applications, can well solve the application of reliability, safety and stability, but its weakness is the price high and the constructing cycle is long. Corresponding
6、to the small or medium enterprise applications, the replace approach is the system framework of lightweight WEB, including the more commonly used methods which are based on the Struts and Hibernate. With the wide application of Spring, the three technology combination may be a better choice as a lig
7、htweight WEB framework. It uses layered structure and provides a good integrated framework for Web applications at all levels in minimizing the Interlayer coupling and increasing the efficiency of development. This framework can solve a lot of problems, with good maintainability and scalability. It
8、can solve the separation of user interface and business logic separation, the separation of business logic and database operation and the correct procedure control logic, etc. This paper studies the technology and principle of Struts and Spring and Hibernate, presenting a proved lightweight WEB appl
9、ication framework for enterprise. 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 16 页 - - - - - - - - - 2 Hierarchical Web Mechanism Hierarchical Web framework including the user presentation layer, business logic layer, data persistence layer ,expansion layer
10、etc, each layer for different function, respectively to finish the whole application. The whole system are divided into different logic module with relatively independent and mutual, and each module can be implemented according to different design. It can realize the system parallel development, rap
11、id integration, good maintainability, scalability. Figure 2.1 is a typical lightweight J2EE application architecture. The Web application layered structure basically is divided into three layers: the presentation layer, business logic layer, data persistence layer28. Figure 2.1 typical lightweight J
12、2EE framework 3 Lightweight Web Application Framework In the application based on B/S structure, Struts framework is used to implement the presentation layer, and Hibernate is used to lasting layer, and Spring is the core of the system. Spring integrates the MVC framework of Struts upward and integr
13、ates the 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 16 页 - - - - - - - - - ORM framework downward. The IOC container manages the dependencies between the various components. The development pattern combined of those three kinds technology realizes the five
14、layers structure of application system, and constructs a Web application development framework29. This frame processing shows as the figure3.1 . Figure 3.1 System Application Framework Struts framework realized MVC design patterns in the presentation layer30. In the presentation layer, the functions
15、 of controller achieved by ActionServlet and ActionMapping. ActionServlet accepts requests from the client, and each ActionMapping realizes mapping between a request and a specific Action. View realizes by the Taglib of the JSP page. Model realizes by Action and ActionForm. Action object calls busin
16、ess logic module interface and submit the response to the right View components. ActionForm component object realizes good data encapsulation for client form ,and realizes mutual support between View and Model. Business layer achieve by JavaBean class, including interfaces for Action calling. These
17、JavaBean also encapsulates Hibernate relationships. Business layer through data conversion and persistence layer to realize interaction with database resources. Persistence layer realizes by Hibernate. Hibernate convert HQL statements in Java class to SQL statements, and operate data sources with JD
18、BC driver, finishing data operation such as add ,delete, modify. Bottom is a relational database. 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 16 页 - - - - - - - - - 4 Struts MVC Framework 4.1 Struts work mechanism To ensure the reuse and efficiency of develo
19、pment process, adopting J2EE technology to build the Web application must select a system framework which has a good performance and been examined31. Only in this way can we ensure not wasting lots of time because of adjusting configuration and achieve application development efficiently and quickly
20、. So, programmers in the course of practice got some successful development pattern which proved practical, such as MVC and O/R mapping, etc; many technologies, including Struts and Hibernate frameworks, realized these pattern. However, Struts framework only settled the separation problem between vi
21、ew layer and business logic layer, control layer, did not provide a flexible support for complex data saving process. On the contrary, Hibernate framework offered the powerful and flexible support for complex data saving process. Therefore, how to integrate two frameworks and get a flexible, low-cou
22、pling solutions project which is easy to maintain for information system, is a research task which the engineering staff is studying constantly. Model-View-Controller (MVC) is a popular design pattern28. It divides the interactive system in three components and each of them specializes in one task.
23、The model contains the application data and manages the core functionality. The visual display of the model and the feedback to the users are managed by the view. The controller not only interprets the inputs from the user, but also dominates the model and the view to change appropriately. MVC separ
24、ates the system functionality from the system interface so as to enhance the system scalability and maintainability. Struts is a typical MVC frame32, and it also contains the three aforementioned components. The model level is composed of JavaBean and EJB components. The controller is realized by ac
25、tion and ActionServlet, and the view layer consists of JSP files. The central controller controls the action execution that receives a request and redirects this request to the appropriate module controller. Subsequently, the module controller processes the request and returns results to the central
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年SSh架构详解 2022 SSh 架构 详解
限制150内