Hibernate relieves the developer from 95 percent of common data persistence related programming tasks, compared to manual coding with SQL and the JDBC API. And it can integrate various Web server or application server, and nearly support all popular databases server.
4.The Integration of Struts and Hibernate
In the open source frameworks, for the presentation part, Tapestry has the powerful and natural combination of pages, its document is too conceptional to benefit programming. And its learning curve was too steep and so on. For the logic part, Spring has a good integration function, but there is a lack of public controller. And EJB depends on the EJB containers, at the same time, it is realized complicatedly. While Struts has been applied extensively because of its advantages.
At present, most of systems apply the relational databases mainly, while Java is an object-oriented language essentially. In Model part of Struts framework application, using SQL and JDBC to operate databases when storing and fetching objects reduces programming efficiency and the systematic maintainability. Traditional J2EE-based application applies heavyweight framework based on EJB that adapts to the large enterprise development, while development and debugging by EJB container need to consume a plenty of time and high price. EJB3 improves the disadvantages of original EJB, but its application is not mature yet.
Hibernate can substitute Container-Managed Persistence (CMP) to accomplish heavy responsibility of permanence in J2EE framework of applying EJB. In a word, Hibernate can resolve the difficulties coming from using traditional CMP, JDBC and Data Access Object(DAO) in a technological development. For reducing the coupling of code and raising systematic development efficiency, this paper suggests J2EE application development tactics based on Struts and Hibernate. The Struts design shows the MVC framework sufficiently, which all control flows need a configuration file (Struts-config.xml) to manage, and which is convenient to maintain. The integration of
Struts and Hibernate is that Hibernate solves the model layer of Struts, which makes developers operate Java objects instead of database. The integration shows the object-oriented thought sufficiently and solves some problems of the database operation in traditional J2EE well.
4.1. Flow of Framework
At first, users send Http requests by Browser, then Http requests are accepted by ActionServlet of the control component in business layer, then gave to RequestProcessor which gets corresponding Action from ActionMapping by request URL. Besides, ActionForm packs JSP pages, which can make a checking to data of datasheet if it is
needed, send back ActionErrors to visual pages if there are mistakes and transfer the data of pages to Action if it passes validation.
RequestProcessor transfers the “execute” method of Action and the method transfers the business logic module. Hibernate accomplishes interaction of databases and JavaBean. The operation of processing business logic interacts with database by data permanence layer and field object layer. The “execute” method of Action will return ActionForward objects that are accepted by ActionServlet after executing. Thereby, ActionServlet is transmitted to the appointed resource of ActionForward, which means the correct view chosen is shown to users.
4.2. Systematic Structure of the Integration Framework
The EIS layer of the multi-layer J2EE systematic structure can be partitioned into the data permanence layer and the data resource layer. It means a system can be pided into five layers as a whole:
Client Layer: This layer runs in the Browser of users’ machines and handles interaction with users, transmits and shows messages to users. J2EE platform supports different type users including HTML users, Java Applets, Java application, etc.
Presentation Layer: This layer works in J2EE Web container, produces the systematic representation logic, handles users’ requests and makes the responses. The entire Web is built on Struts framework, in which the View component is composed of JSP/HTML pages whose data is expressed by ActionForm Bean, the Controller component is composed of ActionServlet united Struts-config.xml and Action Classes, and the Model component is realized by business logic layer.
上一篇:电子商务网站的设计英文文献和中文翻译
下一篇:宽带互联网服务英文文献和中文翻译

AngularJS技术介绍英文文献和中文翻译

开关电源水冷却系统英文文献和中文翻译

减数分裂和基因重组英文文献和中文翻译

太阳能最大功率点追踪和...

移动码头的泊位分配问题英文文献和中文翻译

虚拟船舶装配集成建模方...

中学生科学探究中对等论...

浅谈高校行政管理人员的...

提高教育质量,构建大學生...

酵母菌发酵生产天然香料...

AES算法GPU协处理下分组加...

浅论职工思想政治工作茬...

上海居民的社会参与研究

基于Joomla平台的计算机学院网站设计与开发

压疮高危人群的标准化中...

STC89C52单片机NRF24L01的无线病房呼叫系统设计

从政策角度谈黑龙江對俄...