




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、成 都 理 工 大 學(xué)學(xué)生畢業(yè)設(shè)計(論文)外文譯文學(xué)生姓名:吳陽學(xué)號:201107050210專業(yè)名稱:電子商務(wù)譯文標(biāo)題(中英文):定義開發(fā)J2EE Web信息系統(tǒng)的方法(Defining methodologies for developing J2EE web-based information systems)譯文出處:Elsevier ScienceDirect全文期刊數(shù)據(jù)庫 指導(dǎo)教師審閱簽名: 外文譯文正文:摘要:本文介紹了基于Java開發(fā)項目的框架概念和背景,并介紹了如何使用它開發(fā)IT項目。開發(fā)框架的產(chǎn)生是由于許多共同的設(shè)計和開發(fā)工作正在以不同的方式重復(fù),并不總是與最佳實踐相一致。
2、我們已經(jīng)確定了共同的企業(yè)和交付應(yīng)用的設(shè)計模式和工具,是有效的解決方案?,F(xiàn)在的開發(fā)框架提供:(1)應(yīng)用開發(fā)堆棧從用戶界面到數(shù)據(jù)整合;(2)為提高和利用其他一些框架的基礎(chǔ)設(shè)施和相關(guān)技術(shù)的體系結(jié)構(gòu),該體系結(jié)構(gòu)定義了一個開發(fā)方法,其目的是協(xié)助用戶開發(fā)項目。1. 介紹軟件工具和復(fù)雜的空間系統(tǒng)分析越來越多地應(yīng)用在Web的用戶界面,實現(xiàn)了基于網(wǎng)絡(luò)平臺的科學(xué)分析,模擬結(jié)果的分布,和科學(xué)家之間的信息交換。實時的基于Web的訪問非線性分析模擬軟件成為許多應(yīng)用系統(tǒng)的一個關(guān)鍵部分。強(qiáng)化技術(shù)改變網(wǎng)絡(luò)的硬件和軟件提供了比過去更多的選擇自由。因此,WEB平臺的合理選擇和發(fā)展是對非線性分析整個地區(qū)日益增加的重要性和其眾多的應(yīng)
3、用。網(wǎng)站目前的發(fā)展階段的特點是大量的開源框架的出現(xiàn)??蚣苁降腤eb開發(fā)的重點轉(zhuǎn)移到一個更高的水平,使基本的功能重用,從而提高開發(fā)效率。在某些情況下,開源框架沒有提供解決常見問題的方法。為此,開發(fā)商建立自己的開發(fā)框架頂部的一個開源框架。本文的目的是描述一個基于Java開發(fā)框架,利用開源框架協(xié)助開發(fā)基于Web的應(yīng)用程序。通過對一些現(xiàn)有的開源框架,本文提出了一種新的體系結(jié)構(gòu),為提高和利用其他一些框架的基礎(chǔ)設(shè)施和相關(guān)技術(shù)。該架構(gòu)定義了自己的開發(fā)方法,其目的是協(xié)助項目定制開發(fā)和集成項目。常見的有應(yīng)用設(shè)計問題往往在項目。即使在獨(dú)特的功能要求,有常用的模式使用的情況下,它本身的設(shè)計與開發(fā)利用。本文介紹了一種
4、“定制”的框架,它一直在努力尋找這樣的常見的應(yīng)用問題和確定的設(shè)計模式,可以由開發(fā)商使用的開發(fā)。這個框架,我們將其稱為發(fā)達(dá)的XYZ的框架,提供了一套模式和工具,建立在行業(yè)最佳實踐,針對常見的應(yīng)用問題。它提供了一個應(yīng)用開發(fā)堆棧,從表現(xiàn)到集成層。本文闡述了這些應(yīng)用問題和模式,工具和行業(yè)最佳實踐。開發(fā)框架可以定制XYZ各種工程的需要。它的開發(fā)和配置基于不同的框架和工具,如Struts,Spring,Hibernate和JUnit。2. 開發(fā)框架主要技術(shù)2.1 代碼層和配置的分離Web應(yīng)用程序有不同的設(shè)計問題如介紹,業(yè)務(wù)邏輯,數(shù)據(jù)訪問與安全。一個分離的設(shè)計問題分為不同的代碼層具有幾個優(yōu)點:易于維護(hù),實現(xiàn)
5、良好的設(shè)計模式的能力,并且能夠選擇專門的工具和技術(shù)的具體問題。分離成一個項目層可以導(dǎo)致這些層之間的依賴關(guān)系。例如,一個使用案例涉及簡單的數(shù)據(jù)錄入和查詢通常必須整合顯示,業(yè)務(wù)邏輯和數(shù)據(jù)訪問在一起以提供所需的功能。因此,必須有一個良好定義的策略來管理依賴關(guān)系。XYZ的框架相結(jié)合的開發(fā)設(shè)計模式,可重用的代碼和配置文件,使盡可能容易。該框架采用控制彈簧的反轉(zhuǎn)來管理依賴性。Spring框架提供了一種方式來聯(lián)系在一起,構(gòu)成一個應(yīng)用程序的對象。它實現(xiàn)了這一目標(biāo),在Spring應(yīng)用程序上下文,這是一個管理對象之間的依賴關(guān)系的策略。Spring使用依賴注入和方法攔截技術(shù)介紹如下。我們寫的代碼是依賴于使用的對象。
6、它負(fù)責(zé)創(chuàng)建這些對象。這可能會導(dǎo)致緊耦合,但我們希望我們的代碼是松散耦合的。依賴注入是一種技術(shù),它可以幫助我們完成這。依賴注入是一種形式的控制反轉(zhuǎn)(IoC)。當(dāng)應(yīng)用程序使用依賴注入,代碼變得更干凈、更容易理解。它是松散耦合的,允許更容易的配置和測試。XYZ框架采用Spring應(yīng)用上下文文件定義層與層之間的依賴關(guān)系。方法攔截是一個面向方面的編程(AOP)的概念。通過JDK動態(tài)代理,Spring AOP實現(xiàn)方法攔截。XYZ框架使用Spring AOP來管理等問題的事務(wù)管理和性能監(jiān)測。開發(fā)的XYZ框架由兩個不同的部分組成:代碼和配置。代碼駐留在一個特定的應(yīng)用層和集中在一個特定的應(yīng)用解決方案。這可能是與
7、數(shù)據(jù)庫的交互,或提交數(shù)據(jù)到屏幕。結(jié)構(gòu)膠的各種應(yīng)用層。從代碼分離配置允許我們獨(dú)立的管理結(jié)構(gòu),給我們不同的配置相同代碼庫的靈活性。例如,一個數(shù)據(jù)訪問對象(DAO)實現(xiàn)知道它是通過一個數(shù)據(jù)源使用JDBC連接到數(shù)據(jù)庫,但不知道數(shù)據(jù)源執(zhí)行什么。它可能來自一個Java命名和目錄接口(JNDI)上下文或來自一個驅(qū)動程序管理器。它可能指向遠(yuǎn)程數(shù)據(jù)庫或本地數(shù)據(jù)庫。不管數(shù)據(jù)源是從哪里來的,道的實施將在同一數(shù)據(jù)源的操作方式。同樣,一個服務(wù)對象可能依賴于道,但不知道刀是通過Hibernate,JDBC實現(xiàn)直,或Web服務(wù)。服務(wù)對象以相同的方式道的相互作用,無論DAO的實現(xiàn)。Spring給我們提供了一種通過Spring
8、應(yīng)用上下文管理我們的應(yīng)用程序的整個結(jié)構(gòu),由一組XML文件定義。我們可以在一個文件中定義的應(yīng)用程序上下文。然而,在較小的文件組中定義它,我們可以簡化配置管理。這樣的應(yīng)用程序上下文文件形成一個完整的應(yīng)用程序配置一個邏輯的集合稱為一個配置集。在開發(fā)基于Java的企業(yè)應(yīng)用程序的標(biāo)準(zhǔn)配置是一個框架的配置設(shè)置使用外部資源為數(shù)據(jù)源和JNDI資源。這種類型的配置有時可以產(chǎn)生問題:(1)一個不完整的數(shù)據(jù)庫尚未加載。開發(fā)商可能想測試某些類型的數(shù)據(jù)顯示,但如果基礎(chǔ)數(shù)據(jù)庫尚未完成,他們將不能夠這樣做。(2)服務(wù)或道可能沒有被開發(fā)出來。結(jié)合未完成的服務(wù)或DAO可能停止發(fā)展。這些問題,降低生產(chǎn)效率。開發(fā)的XYZ框架已經(jīng)從
9、它的代碼分離的結(jié)構(gòu),我們可以使用一個配置設(shè)置專門針對向發(fā)展。這減輕了我們擔(dān)心外部系統(tǒng)的可用性,這是解決眼前的發(fā)展無關(guān)的需求。開發(fā)的XYZ框架定義了兩個配置設(shè)置:默認(rèn)和獨(dú)立。我們還可以自定義應(yīng)用程序添加基于我們的項目需要額外的配置集。默認(rèn)的配置設(shè)置連接使用定義在JNDI DataSource開發(fā)數(shù)據(jù)庫。它以充分開發(fā)應(yīng)用服務(wù)和道。獨(dú)立的配置集是發(fā)展最為靈活的環(huán)境。這個配置集:(1)連接到一個本地安裝的數(shù)據(jù)庫或使用DriverManagerDataSource開發(fā)數(shù)據(jù)庫;(2)使用彈簧的地方DataSourceTransactionManager事務(wù)管理;(3)充分利用開發(fā)應(yīng)用服務(wù)和道;和(4)完全
10、有線的Spring應(yīng)用程序上下文可以運(yùn)行和測試完全的應(yīng)用服務(wù)器外面。開發(fā)框架是由XYZ應(yīng)用上下文配置。應(yīng)用程序上下文可以在一個或多個XML文件中定義。配置集是一組XML文件定義一個應(yīng)用程序上下文。配置集分為兩個部分:服務(wù)和Web。服務(wù)部分定義服務(wù),DAO,資源和服務(wù)整合層。Web部件定義了表示層組件。配置集沒有這兩部分是不完整的。開發(fā)的XYZ框架配置集是由調(diào)用一個bean的引用的文件和定義分組perties beanrefcontext.xml。beanrefcontext.xml文件定義的所有配置的服務(wù)集。此文件位于服務(wù)項目的src
11、/配置目錄。配置設(shè)置應(yīng)用程序上下文之間共享文件也位于此目錄。此外,每個配置有它自己的子目錄,其中包含了特定的文件。例如,服務(wù)和道,之間的配置設(shè)置共享,同時支持服務(wù)(如數(shù)據(jù)源)屬于子目錄。XML文件定義彈簧豆在這個應(yīng)用中使用MathML的查看源bean標(biāo)簽。Spring bean是一個創(chuàng)建和應(yīng)用程序上下文初始化Java對象。2.2 類和限制利用開發(fā)的XYZ框架,下面的代碼和配置構(gòu)件將通常需要開發(fā)一個用戶界面:(a)行動,ActionForm類和xml條目;(b)服務(wù)接口和實現(xiàn)類;(C)DAO接口和實現(xiàn)類;(d)以上之間的依賴關(guān)系管理。當(dāng)開始開發(fā)一個用例,我們必須意識到所有這些類和它們的依賴就需要
12、。2.3 測試技術(shù)測試應(yīng)該是發(fā)展過程中的一個組成部分。使用開發(fā)的XYZ框架構(gòu)建的應(yīng)用程序,單元測試是一個測試方法在服務(wù)或集成層。表現(xiàn)層構(gòu)件(動作類)不采取單元測試。測試的目的是確保行為的類封裝工程預(yù)期的測試時,與其他組件的整合。在應(yīng)用程序的單元測試,使用開發(fā)的XYZ框架開發(fā)的,是基于JUnit框架。不同于單元測試,集成測試需要代碼依賴關(guān)系可用。本試驗的目的是確保不同階層之間的整合(由不同的開發(fā)商開發(fā)的)的工作原理。功能測試過程中,重點是通過數(shù)據(jù)來描述不同的情況下,應(yīng)用程序的功能測試。功能測試通常需要測試的類中的服務(wù)層與不同的數(shù)據(jù)。它也可以由用戶接口層測試和使用真正的依賴關(guān)系進(jìn)行。為了執(zhí)行不同類
13、型的測試,所開發(fā)的應(yīng)用程序必須是可檢驗的。我們列出了一些可測試的應(yīng)用程序的基本特征。(1)開發(fā)單元測試和集成測試,緩解。我們應(yīng)該不必使用數(shù)據(jù)源能夠單元測試,或隊列。同時,我們應(yīng)該能夠模擬依賴關(guān)系的測試代碼。(2)模擬功能測試各種測試場景輕松。(3)重新運(yùn)行所有的測試反復(fù)應(yīng)用的生命周期,緩解。(4)清潔測試代碼分離從應(yīng)用程序代碼。一個結(jié)構(gòu)良好的應(yīng)用程序,將設(shè)計問題如介紹,服務(wù)和數(shù)據(jù)訪問的設(shè)計可測試的應(yīng)用程序是非常重要的。應(yīng)用吸氣劑,開始編碼者,變量等,然后結(jié)合,提供所需的解決方案。單元測試是所有測試方法的基本構(gòu)建塊。開發(fā)框架的設(shè)計有利于XYZ可測試應(yīng)用程序的開發(fā):提供測試模板類來創(chuàng)建單元測試;并
14、能適應(yīng)試驗應(yīng)用易于配置的需要。單元測試可以運(yùn)行像任何JUnit測試。專門開發(fā)的默認(rèn)“創(chuàng)建腳本”提供了一個任務(wù)運(yùn)行單元測試。這個任務(wù)可以被稱為在生成部署EAR文件或可單獨(dú)運(yùn)行。2.4 Web演示文稿設(shè)計開發(fā)的XYZ框架使用Struts框架的概念和JavaScript實現(xiàn)表示關(guān)注,并提供額外的功能,可以延長使用的項目。當(dāng)使用Struts框架進(jìn)行開發(fā),首先我們建立動作servlet在web.xml;然后我們建立配置,動作映射,形成豆和地方在struts-config.xml向前;最后建立驗證規(guī)則在xml。這種方法已經(jīng)在使用了XYZ框架創(chuàng)建的應(yīng)用程序的改變,使得開發(fā)商不能直接編輯struts-conf
15、ig.xml或xml。而我們指定這一信息xdoclet注釋和ActionForm類的直接行動。然后將此信息通過運(yùn)行Ant腳本轉(zhuǎn)移到struts-config.xml和xml。有兩種類型的驗證是必需的:格式數(shù)據(jù)驗證和業(yè)務(wù)邏輯驗證。數(shù)據(jù)格式驗證是最好的表現(xiàn)層,業(yè)務(wù)邏輯驗證時,最好是在服務(wù)層做。業(yè)務(wù)邏輯驗證錯誤,在服務(wù)層中發(fā)生的,應(yīng)該把自定義的異常處理。以下是表現(xiàn)層的設(shè)計目標(biāo):(1)只有一個動作,每一級提升的JSP程序。一個單一的網(wǎng)頁都必須在一個單一的動作類的處理。(2)依賴和使用xdoclet注釋指定驗證規(guī)則。(3)開發(fā)商應(yīng)避免或盡量減少Session對象的使用,因為它阻礙了擴(kuò)展性。XYZ框架提供
16、了一個默認(rèn)的模板動作類,包含解決上述設(shè)計目標(biāo)的這一層。下面是典型的代碼開發(fā)一個網(wǎng)頁要求:(1)創(chuàng)建一個新的JSP與默認(rèn)隱藏字段“actiontype”使用,預(yù)計將在頁面上出現(xiàn)的用戶行為的處理。(2)創(chuàng)建一個新的動作類,擴(kuò)展了這類模板的作用。我們必須指定依賴的ActionForm具體方法,處理用戶的操作表示的值的隱藏字段“actiontype”。之后,我們可以宣布權(quán)限才能訪問此動作類。這是在Spring的配置文件了。(3)創(chuàng)建一個新的ActionForm類和指定驗證規(guī)則使用xdoclet注釋要求。一旦JSP,Action和ActionForm的創(chuàng)建,它是必要的運(yùn)行Ant腳本生成Struts配置X
17、ML文件?!?。2.5 數(shù)據(jù)庫訪問發(fā)達(dá)的XYZ框架支持直接使用JDBC,Hibernate框架堅持發(fā)送數(shù)據(jù)到關(guān)系數(shù)據(jù)庫構(gòu)建的應(yīng)用程序。應(yīng)用程序配置必要的Spring上下文文件。道直接使用JDBC必須從Spring框架的jdbcdaosupport.java類擴(kuò)展。同樣,使用Hibernate DAO必須從Spring框架的hibernatedaosupport.java類擴(kuò)展。2.6 通過注釋配置開發(fā)的XYZ框架使用Spring框架保持在應(yīng)用程序之間的依賴關(guān)系的代碼。這些依賴關(guān)系(例如,Action和ActionForm之間)被配置在Struts配置。XML”,而另一些人(例如服務(wù)和道之間)被配
18、置在Spring應(yīng)用程序上下文文件(XML ApplicationContext。)。在一個團(tuán)隊環(huán)境,這些配置文件是由開發(fā)商。這就是為什么版本沖突,這些配置文件可能會發(fā)生。開發(fā)的XYZ框架提供了一個新的有效的方法,使用特殊的注解來指定所有這些依賴關(guān)系。通過使用這些注釋,結(jié)構(gòu)變得簡單和沖突的更改配置,避免工件。3. 開發(fā)框架的服務(wù)開發(fā)的XYZ框架促進(jìn)普通Java對象(POJO)用以實現(xiàn)業(yè)務(wù)邏輯。業(yè)務(wù)邏輯必須聲明為接口。所有服務(wù)的實現(xiàn)必須實現(xiàn)一個或多個業(yè)務(wù)接口。這是建議的服務(wù)層將自定義的業(yè)務(wù)異常時有業(yè)務(wù)規(guī)則驗證錯誤。開發(fā)的XYZ框架采用了一種基于Spring框架的聲明式事務(wù)管理辦法。這是使用面向方
19、面的編程(AOP)的實現(xiàn)。開發(fā)的XYZ框架促進(jìn)良好的分離部署接口實踐(服務(wù)消費(fèi)者合同)從服務(wù)接口(合同代表應(yīng)用程序的業(yè)務(wù)邏輯)。配置接口是一個Java接口表示在WSDL服務(wù)暴露。實現(xiàn)該接口的類都必須委托請求,實現(xiàn)服務(wù)接口的類。這保證了所有的業(yè)務(wù)邏輯保持在正確的層的一個地方。服務(wù)接口是一個Java接口代表業(yè)務(wù)邏輯。在大多數(shù)情況下,部署接口將包含來自服務(wù)接口方法的一個子集。Apache Axis 1.2.4 Web服務(wù)框架是Web服務(wù)目前的標(biāo)準(zhǔn)。當(dāng)Web服務(wù)的開發(fā),有兩種不同的方法。合同與合同之間的差異首先在于最后的方法是先創(chuàng)建WSDL或是否由代碼生成。合同的第一個方法是開發(fā)Web服務(wù)的一個很好的
20、做法,在服務(wù)消費(fèi)者和提供者的外部供應(yīng)商可能使用不同的技術(shù)實現(xiàn)Web服務(wù)(可以使用代替Java)。4. 中間層的集成有結(jié)合外部資源,如數(shù)據(jù)庫和Web服務(wù)的幾種技術(shù)。開發(fā)的XYZ框架使用這些技術(shù)在一個邏輯層被稱為“集成”層。這一層的設(shè)計目標(biāo)是:(1)對數(shù)據(jù)庫的訪問采用JDBC或Hibernate應(yīng)該封裝在數(shù)據(jù)訪問對象(DAO)。(2)消費(fèi)Web服務(wù)應(yīng)該盡可能的簡單。(3)所有外部數(shù)據(jù)格式轉(zhuǎn)換成應(yīng)用程序域的對象應(yīng)限于這一層。(4)在這一層的單元測試類應(yīng)該是簡單和容易的事。開發(fā)的XYZ框架支持使用Hibernate和JDBC調(diào)用訪問關(guān)系數(shù)據(jù)庫。這是推薦使用Spring的JdbcTemplate和模板類
21、模板類。當(dāng)使用直接JDBC訪問關(guān)系型數(shù)據(jù)庫,建議應(yīng)用DAO從Spring框架的jdbcdaosupport延伸。JdbcTemplate類管理用于數(shù)據(jù)庫訪問的資源(例如PreparedStatement)。開發(fā)的XYZ框架插入數(shù)據(jù)源使用應(yīng)用程序配置文件道。當(dāng)使用Hibernate訪問關(guān)系數(shù)據(jù)庫,Hibernate的SessionFactory是通過應(yīng)用程序配置文件注入應(yīng)用DAO。5. 開發(fā)的生命周期開發(fā)的XYZ框架強(qiáng)調(diào)結(jié)構(gòu)能夠在一個開發(fā)團(tuán)隊的角色和相互關(guān)系的明確定義。三個角色描述如下。這種角色之間的相互作用是應(yīng)用開發(fā)的成功完成的關(guān)鍵。(一)前端開發(fā)人員專注于開發(fā)JSP,行動ActionForm
22、類和web服務(wù)。(b)服務(wù)的開發(fā)者專注于開發(fā)應(yīng)用服務(wù)和整合這些服務(wù)使用應(yīng)用程序的不同部分。(C)集成開發(fā)人員致力于開發(fā)集成構(gòu)件如道,或使用Web服務(wù)。一個發(fā)展中的基本問題是如何開發(fā)和集成代碼時,其依賴的組件沒有準(zhǔn)備好或不可用。開發(fā)的XYZ框架解決了這個問題,以聲明方式注入“模仿對象”取代“真正的對象作為開發(fā)生命周期的進(jìn)展模擬對象”提供了一個結(jié)構(gòu)。這可能是由于使用不同的配置設(shè)置應(yīng)用程序配置的能力。該框架能夠使測試團(tuán)隊發(fā)展過程中的一個組成部分。這是通過編寫和運(yùn)行JUnit測試成為可能。該框架的重點是測試應(yīng)用服務(wù)和它們的依賴關(guān)系。應(yīng)用程序部署在一個單一的企業(yè)歸檔(EAR)文件。發(fā)達(dá)的Ant腳本生成此
23、EAR文件,可以手動運(yùn)行或定期通過調(diào)度器。建議在創(chuàng)建用于部署的耳朵運(yùn)行所有的JUnit測試。6. 結(jié)論在本文中,作者提供了開發(fā)J2EE框架概述。作者已經(jīng)解決了重要的構(gòu)架,技術(shù)和發(fā)展的步驟之一,應(yīng)該在J2EE項目中考慮。信息是從現(xiàn)實世界的經(jīng)驗,旨在幫助開發(fā)人員構(gòu)建J2EE系統(tǒng),設(shè)計自己的自定義框架。然而,這僅僅是冰山的一角,沒有短論文詳細(xì)描述J2EE的潛在的科學(xué)和企業(yè)應(yīng)用程序的影響,特別是,基于非線性分析的仿真軟件網(wǎng)。 Defining methodologies for developing J2EE web-based information systemsVolume 71, Issue
24、12, 15 December 2010, Pages e1633e1637Askar S. BoranbayevEurasianNationalUniversity,5MunaitpassovStreet,Astana,010008,KazakhstanAvailable online 5 February 2010AbstractThis paper describes the concepts behind the developed framework for Java-based projects and describes how it can be used for IT pro
25、jects. The developed framework was created because many common design and development tasks are being repeated in different ways, and are not always consistent with best practices. We have identified common application concerns and delivered design patterns and tools that represent effective solutio
26、ns. The developed framework delivers: (1) an application development stack starting from the user interface to data integration; (2) an architecture, infrastructure and associated techniques for enhancing and leveraging some other frameworks. The proposed architecture defines a development methodolo
27、gy, which is designed to assist in custom development projects.KeywordsJ2EE; Framework; Web development1. IntroductionSoftware tools and packages for the nonlinear analysis of complex spatialdynamic systems increasingly use Web-based networking platforms for the implementation of their user interfac
28、e, scientific analysis, distribution of simulation results, and information exchange among scientists. The real-time Web-based access to nonlinear analysis simulation software becomes a critical part of many applied systems. The intensive technological change in networking hardware and software
29、;1 provides more freedom of choices than in the past 2. Therefore, the rational selection and development of the Web platform is of increasing importance for the whole area of nonlinear analysis and its numerous applications. The current stage of Web development is characterized by the emergenc
30、e of a significant number of open source frameworks. Frameworks shift the focus of Web development to a higher level, allowing the reuse of basic functionality and thus increasing the productivity of development.In some cases, open source frameworks do not provide a solution to common problems. For
31、this reason, developers build their own development framework on top of an open source framework. The aim of this paper is to describe a developed Java-based framework that leverages open source frameworks and assists in developing Web-based applications. By analyzing some existing open source frame
32、works, this paper presents a new architecture, infrastructure and associated techniques for enhancing and leveraging some other frameworks. The proposed architecture defines its own development methodology, which is designed to assist in custom development projects and integration projects.There are
33、 common application design concerns which are often used across projects. Even across unique functional requirements, there are commonly occurring patterns of use cases, which lend themselves to design and development reuse. This paper describes a “customized” framework, which had been developed in
34、an effort to identify such common application concerns and identify design patterns that can be used by the developers. This framework, which we will refer to as the developed XYZ framework, provides a set of patterns and tools that were built on industry best practices, tailored to common applicati
35、on concerns. It provides an application development stack, from presentation to integration layers. This paper articulates these application concerns and the patterns, tools and industry best practices. The developed XYZ framework can be customized to various projects needs. It was developed and con
36、figured based on various frameworks and tools such as Struts, Spring, Hibernate and JUnit.2. Major technologies of the developed framework2.1. Layers and separation of code and configurationWeb applications have various design concerns such as presentation, business logic, data access and security.
37、A separation of design concerns into distinct code layers has several advantages such as: ease of maintenance, the ability to implement good design patterns, and the ability to select specialized tools and techniques for specific concerns. Separating a project into layers can result in dependencies
38、between those layers. For example, a single-use case involving simple data entry and inquiry usually must integrate presentation, business logic and data access together to deliver required functionality 3. Therefore, there must be a well defined strategy to manage the dependency relationships.
39、 The developed XYZ framework combines design patterns, reusable code and configuration files to make this as easy as possible. This framework uses Springs Inversion of Control to manage dependencies. The Spring Framework 4 provides a way to tie together the objects that make up an application.
40、It accomplishes this goal with the Spring Application Context, which is a strategy for managing dependencies between objects. Spring uses dependency injection and method interception techniques described below.The code that we write is dependent on the objects it uses. It is responsible for creating
41、 these objects. This may result in tight coupling, but we would prefer that our code be loosely coupled. Dependency injection is a technique which helps us to accomplish this. Dependency injection is a form of Inversion of Control (IoC) 5. When applications use dependency injection, the code be
42、comes much cleaner and easier to follow. It is also loosely coupled, allowing for easier configuration and testing. The XYZ framework uses several Spring application context files to define dependencies between the layers. Method interception is a concept of Aspect Oriented Programming (AOP) 6.
43、 Spring AOP implements method interception through JDK dynamic proxies. The XYZ framework uses Spring AOP to manage concerns such as transaction management and performance monitoring.The developed XYZ framework consists of two distinct parts: code and configuration. Code resides in a particular appl
44、ication layer and focuses on a particular piece of the application solution. This could be interacting with a database, or presenting data to the screen. Configuration glues the various layers of the application together. Separating configuration from code allows us to manage configuration independe
45、ntly, giving us the flexibility of applying different configurations to the same code base. For example, a Data Access Objects (DAO) implementation knows that it is using JDBC to connect to a database through a data source, but it does not know anything about the implementation of that data source.
46、It may come from a Java Naming and Directory Interface (JNDI) context or be derived from a driver manager. It may point to the remote database or a local database. Regardless of where the data source comes from, the DAO implementation will operate on the data source in the same manner. Likewise, a S
47、ervice object may depend on a DAO, but it does not know whether the DAO is implemented via Hibernate, straight JDBC, or a Web service. The service object interacts with the DAO in the same manner, regardless of the DAOs implementation.Spring gives us a way to manage our applications entire configura
48、tion through a Spring application context, defined by a set of XML files. We could define the application context in one file. However, by defining it in groups of smaller files, we can simplify configuration management. A logical set of such application context files which forms a complete applicat
49、ion configuration is called a configuration set.During the development of Java-based enterprise applications the standard configuration is where a frameworks configuration set uses external resources such as data sources and JNDI resources. This type of configuration sometimes can create problems wi
50、th: (1) An incomplete database that has not yet been loaded. Developers may want to test the display of certain types of data, but if the underlying database has not yet been completed, they will not be able to do this. (2) Services or DAOs that may not have been developed yet. Integrating with unfi
51、nished services or DAOs may halt development.These issues decrease productivity. The developed XYZ framework has separated its configuration from its code, we can use an alternate configuration set targeted specifically towards development. This relieves us from worrying about the availability of ex
52、ternal systems, which are irrelevant to solving immediate development needs.The developed XYZ framework defines two configuration sets: default and standalone. We can also customize our application by adding additional configuration sets based on our project needs. The default configuration set conn
53、ects to the development database using the DataSource defined in JNDI. It uses fully developed application services and DAOs. The standalone configuration set is the most flexible environment for development. This configuration set: (1) connects to either a locally installed database or the developm
54、ent database using a DriverManagerDataSource; (2) uses Springs DataSourceTransactionManager for local transaction management; (3) uses fully developed application Services and DAOs; and (4) fully wired Spring application contexts can be run and tested entirely outside of the application server.The d
55、eveloped XYZ framework is configured by its application context. The application context may be defined in one or more XML files. A configuration set is a set of XML files that define one application context. The configuration set consists of two parts: service and Web. The service part defines serv
56、ices, DAOs, and resources for the service and integration layers. The Web part defines components for the presentation layer. A configuration set cannot be complete without both of these parts.The developed XYZ framework configuration sets are grouped together by what Spring calls a bean reference c
57、ontext defined in the files beanRefContext.xml and applicationContextMperties. The beanRefContext.xml file defines the service part of all configuration sets. This file is located in the src/config directory of the service project. Application context files shared between configurat
58、ion sets are also located in this directory. In addition, each configuration set has its own subdirectory, which contains files specific to it. Services and DAOs, for instance, are shared between configuration sets, while supporting services (like data sources) belong in the subdirectories. XML file
59、s define the Spring beans in this application by using the bean tag. A Spring bean is a Java object created and initialized by the application context.2.2. Classes and dependenciesUsing the developed XYZ framework, the following code and configuration artifacts will be typically required to develop a user interface screen: (a) Action, ActionForm classes and validation.xml entries; (b) service interface and implementation class; (c) DA
溫馨提示
- 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)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 復(fù)混肥料在農(nóng)業(yè)現(xiàn)代化進(jìn)程中的角色考核試卷
- 智能交通管理系統(tǒng)的運(yùn)營與維護(hù)考核試卷
- 體育表演跨國合作案例考核試卷
- 辦公設(shè)備培訓(xùn)課程考核試卷
- 推廣會議合同范本
- 工地噴錨合同范本
- 兼職項目加工合同范本
- 物聯(lián)網(wǎng)技術(shù)在智能家居領(lǐng)域的合同
- 年度項目進(jìn)度計劃及任務(wù)分配方案書
- 智慧農(nóng)業(yè)技術(shù)服務(wù)合同
- 2025年舞蹈培訓(xùn)機(jī)構(gòu)學(xué)員培訓(xùn)合同范本
- 2025年保險銷售業(yè)務(wù)人員崗位職業(yè)技能資格知識考試題(附答案)
- 兒科護(hù)理模擬考試題與參考答案
- 注意缺陷與多動障礙疾病科普幼兒心理健康教育課件
- 區(qū)域臨床檢驗中心
- 2024年07月長沙農(nóng)村商業(yè)銀行股份有限公司2024年招考3名信息科技專業(yè)人才筆試歷年參考題庫附帶答案詳解
- 中醫(yī)預(yù)防流感知識講座
- 船舶水下輻射噪聲指南 2025
- 2024年黑龍江哈爾濱市中考英語真題卷及答案解析
- 房屋市政工程生產(chǎn)安全重大事故隱患判定標(biāo)準(zhǔn)(2024版)宣傳畫冊
- 2025年中國配音行業(yè)市場現(xiàn)狀、發(fā)展概況、未來前景分析報告
評論
0/150
提交評論