毕业论文

打赏
当前位置: 毕业论文 > 外文文献翻译 >

java Struts和Hibernate的结构整合英文文献和中文翻译(2)

时间:2019-08-03 17:47来源:毕业论文
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 a


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. java Struts和Hibernate的结构整合英文文献和中文翻译(2):http://www.youerw.com/fanyi/lunwen_36765.html
------分隔线----------------------------
推荐内容