咋一篇文章連個題目也沒有啊_第1頁
咋一篇文章連個題目也沒有啊_第2頁
咋一篇文章連個題目也沒有啊_第3頁
咋一篇文章連個題目也沒有啊_第4頁
咋一篇文章連個題目也沒有啊_第5頁
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、咋一篇文章連個題目也沒有啊?This text analysis the mechanism of Hibernate and Struts, put forward 1 kind EE according to the J2 of the Hibernate and the Struts application development strategy.In this kind of strategy, the model layer use a Hibernate realization and see diagram and controller to then use a Struts

2、 frame a realization.So can consumedly lower the development efficiency that the Ou of code match sex and exaltation system. The key word Hibernate, Struts, the MVC, hold out for long time a layer one preface along with the Java technique of gradual mature and perfect, Be establishment business ente

3、rprise class application of standard terrace, the J2 EE terrace got substantial of development.Several technique asked for help from to include in the J2 EE norm:Enterprise JavaBean(EJB), Java Servlets(Servlet), Java Server Pages(JSP), Java Message Service(JMS).etc., development many application sys

4、tem.But, also appeared some problem in the tradition J2 the EE the application of the development the process:1)the antinomy of of data model and logic model.Currently the database of usage basically and all is relation type database, but the Java be essentially a kind of the language which face to

5、object, object at saving with read usage SQL and JDBC carry on a database operation and lowered plait distance of efficiency and system of can maintenance;2)tradition of J2 EE application much the adoption is according to the EJB heavy weight frame, this kind of frame suitable for develop a large bu

6、siness enterprise application, but usage the EJB container carry on development and adjust to try to need to be waste a great deal of time.For lowering the Ou of code to match sex, exaltation system of development efficiency, this text put forward 1 kind EE according to the J2 of the Struts frame an

7、d the Hibernate frame application development strategy. 2 datas holding out for long time layer and Hibernate is one piece according to hold out for long time layer frame, is a kind of realization object and relation of the tool which reflect to shoot(O/R Mapping), it carried on the object of the li

8、ghtweight to pack to the JDBC and make procedure member can usage object plait distance thought to operation database.It not only provided to shoot from Java to reflect of data form, but also provided a data a search and instauration mechanism.Opposite in usage JDBC and SQL to operation database, us

9、e a Hibernate ability consumedly of exaltation realization of efficiency.The Hibernate frame use allocation document of the form come to the reflect of the definition Java object and data form to shoot relation, in the meantime at more deep of level of data form of relation explanation for the relat

10、ions such as inherit of and containment etc. of Java object.Pass the usage HQL language sentence complications of relation the calculate way use the way of object description, to a large extent simplification logarithms according to of search, speed development of efficiency.Have in the Hibernate a

11、simple but keep the API of view, used for to the database mean of object performance search.Want to establish or the modification be these objects, need in the procedure carry on with them to hand over with each other, then tell Hibernate to keep.So, a great deal of pack hold out for long time turn

12、operation of business logic no longer demand write a trivial JDBC language sentence, make data last long thus the layer got biggest of simplification. 3 use the Struts realization MVC structure MVC(Model-View-Controller) is put forward by the Trygve Reenskaug, first drive application in the environm

13、ent SmallTalk-80, is many to hand over with each other with interface system of constitute foundation.According to the need of variable of the interface design, MVC hand over with each other constitute of system to resolve into model and see diagram, controller three part. Model(Model) is software p

14、rocessing problem logic at independence in outside manifestation under contents and form circumstance of inside abstract, packed the core data, logic of problem and function of calculation relation, independence in concrete of interface expression and I/O operation.See diagram(View) mean information

15、 and particular form demonstration of model data and logic relation and appearance to the customer.It acquire a manifestation information from the model, there can be many for homology of information dissimilarity of manifestation form or see diagram.The controller(Controller) is a processing the cu

16、stomer hand over with software with each other operation of, its job is control provide model in any variety of dissemination, insure a customer interface among the model of rightness should contact;It accept a customer of importation, give the importation feedback model, then realization compute mo

17、del control, is make model and see diagram to moderate work of parts.Usually 1 see a diagram rightness should a controller.Model, see separate of diagram and controller, make a model be able to have many manifestation to see diagram.If the customer pass a certain see the controller of diagram change

18、 the data of model, all other dependence in these see of data diagram all should reflection arrive these variety.When therefore and regardless occurrence what data variety, controller all would variety notice allly see diagram, cause manifestation of renewal.This is actually a kind of variety of mod

19、el-dissemination mechanism. The Struts frame is to be the item of Apache Jakarta to constitute part to publish luck to do at the earliest stage, it inheritted MVC of each item characteristic, and did according to the characteristics of J2 EE correspond of variety with expand.The Struts frame was goo

20、d to combine Jsp, Java Servlet, Java Bean, Taglib etc. technique.In the Struts, what to undertake the controller role in the MVC be an ActionServlet.The ActionServlet is an in general use control module.This control module provided a processing all HTTP claim which send out Struts of entrance point.

21、Its interception with distribute these claim to arrive correspond of action type.(these action all of type is Action son type)Moreover the control module is also responsible for using to correspond of claim the parameter fill Action Form(FromBean), and pass action type(ActionBean).Action type the bu

22、siness logic of the interview core, then interview Java Bean or adjust to use EJB.End action type control the power pass follow-up of JSP document, from JSP document born see diagram.All these control logic make use of Struts-config.xml the document come to allocation.See diagram in the Struts frame

23、 main from JSP born page completion, the Struts provide abundant of JSP label database, this is advantageous to separating performance logic and procedure logic.The model is with 1 or the form existence of several Java Bean.In the Struts, main existence three kinds of Bean, respectively BE:Action, A

24、ctionForm, EJB perhaps Java Bean. The Struts frame have no concrete definition model layer of realization, in actually the development, model layer usually is close with business logic connect with each other, and want to carry on operation to the first floor data.The underneaths introduction is a k

25、ind of development strategy, lead the Hibernate into the model layer of Struts frame, usage it to carry on a data to pack with reflect to shoot, provide hold out for long time turn of support. 4 usage Hibernate and the Struts development J2 EE application 4.1 system structure diagram 3 manifestation

26、 according to Hibernate and Struts development strategy of system structure diagram. 本文分析了Hibernate和Struts的機(jī)制,提出了一種基于Hibernate和Struts的J2EE應(yīng)用開發(fā)策略。在這種策略中,模型層用Hibernate實(shí)現(xiàn),視圖和控制器則用Struts框架實(shí)現(xiàn)。這樣可大大降低代碼的耦合性以及提高系統(tǒng)的開發(fā)效率。 關(guān)鍵字 Hibernate,Struts,MVC,持久層 1 引言 隨著Java技術(shù)的逐漸成熟與完善,作為建立企業(yè)級應(yīng)用的標(biāo)準(zhǔn)平臺,J2EE平臺得到了長足的發(fā)展。借助于J2E

27、E規(guī)范中包含的多項(xiàng)技術(shù):Enterprise JavaBean(EJB)、Java Servlets(Servlet)、Java Server Pages(JSP)、Java Message Service(JMS)等,開發(fā)出了許多應(yīng)用系統(tǒng)。但是,在傳統(tǒng)J2EE應(yīng)用的開發(fā)過程中也出現(xiàn)了一些問題:1)數(shù)據(jù)模型和邏輯模型之間的矛盾。目前使用的數(shù)據(jù)庫基本上都是關(guān)系型數(shù)據(jù)庫,而Java本質(zhì)上是一種面向?qū)ο蟮恼Z言,對象在存儲和讀取時(shí)使用SQL和JDBC進(jìn)行數(shù)據(jù)庫操作,降低了編程的效率以及系統(tǒng)的可維護(hù)性;2)傳統(tǒng)的J2EE應(yīng)用多采用基于EJB的重量級框架,這種框架適合于開發(fā)大型企業(yè)應(yīng)用,但是使用EJB容器

28、進(jìn)行開發(fā)和調(diào)試需要耗費(fèi)大量時(shí)間。為了降低代碼的耦合性,提高系統(tǒng)的開發(fā)效率,本文提出了一種基于Struts框架和Hibernate框架的J2EE應(yīng)用開發(fā)策略。 2 數(shù)據(jù)持久層及Hibernate Hibernate是一個數(shù)據(jù)持久層框架,是一種實(shí)現(xiàn)對象和關(guān)系之間映射(O/R Mapping)的工具,它對JDBC進(jìn)行了輕量級的對象封裝,使程序員可以使用對象編程思想來操作數(shù)據(jù)庫。它不僅提供了從Java類到數(shù)據(jù)表的映射,也提供了數(shù)據(jù)查詢和恢復(fù)機(jī)制。相對于使用JDBC和SQL來操作數(shù)據(jù)庫,使用Hibernate能大大的提高實(shí)現(xiàn)的效率。Hibernate框架用配置文件的形式來定義Java對象和數(shù)據(jù)表之間的映

29、射關(guān)系,同時(shí)在更深的層面將數(shù)據(jù)表之間的關(guān)系解釋為Java對象之間的繼承及包含等關(guān)系。通過使用HQL語句將復(fù)雜的關(guān)系算法用對象的方式描述,在很大程度上簡化了對數(shù)據(jù)的查詢,加快了開發(fā)的效率。在Hibernate中有一個簡單而直觀的API,用于對數(shù)據(jù)庫所表示的對象執(zhí)行查詢。要創(chuàng)建或修改這些對象,只需在程序中與它們進(jìn)行交互,然后告訴Hibernate保存即可。這樣,大量封裝持久化操作的業(yè)務(wù)邏輯不再需要編寫煩瑣的JDBC語句,從而使數(shù)據(jù)持久層得到了極大的簡化。 3 用Struts實(shí)現(xiàn)MVC架構(gòu) MVC(Model-View-Controller)由Trygve Reenskaug提出,首先被應(yīng)用在SmallTalk-80環(huán)境中,是許多交互和界面系統(tǒng)的構(gòu)成基礎(chǔ)。根據(jù)界面設(shè)計(jì)可變性的需求,MVC把交互系統(tǒng)的組成分解成模型、視圖、控制器三部分。 模型(Model)是軟件所處理問題邏輯在獨(dú)立于外在顯示內(nèi)容和形式情況下的內(nèi)在抽象,封裝了問題的核心數(shù)據(jù)、邏輯和功能的計(jì)算關(guān)系,獨(dú)立于具體的界面表達(dá)和I/O操作。視圖(View)把表示模型數(shù)據(jù)及邏輯關(guān)系和狀態(tài)的信息及特定形式展示給用戶。它從模型獲得顯示信息,對于相同的信息可以有多個不同的顯示形式或視圖??刂破鳎–ontroller)

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論