




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、学校代码: 10128学 号: 本科毕业设计外文文献翻译 翻译翻译二 一 五 年 一 月The Test Library ManagementSystem of FrameworkBasedonSSHTheapplicationsystemfeaturesinsmallormedium-sizedenterpriselieinthegreaterflexibilityandsafetyhighperformance-priceratio.TraditionalJ2EEframeworkcannotadapttotheseneeds,butthesystemapplicationbasedonS
2、SH(Struts+Spring+Hibernate)technologycanbettersatisfysuchneeds.ThispaperanalysessomeintegrationtheoryandkeytechnologiesaboutSSH,andaccordingtotheintegrationconstructsalightweightWEBframework,whichhasintegratedthethreekindsoftechnology,formingthelightweightWEBframeworkbasedonSSHandgaininggoodeffectsi
3、npracticalapplications.IntroductionGenerallytheJ2EEplatform27usedinlargeenterpriseapplications,canwellsolvetheapplicationofreliability,safetyandstability,butitsweaknessisthepricehighandtheconstructingcycleislong.Correspondingtothesmallormediumenterpriseapplications,thereplaceapproachisthesystemframe
4、workoflightweightWEB,includingthemorecommonlyusedmethodswhicharebasedontheStrutsandHibernate.WiththewideapplicationofSpring,thethreetechnologycombinationmaybeabetterchoiceasalightweightWEBframework.ItuseslayeredstructureandprovidesagoodintegratedframeworkforWebapplicationsatalllevelsinminimizingtheI
5、nterlayercouplingandincreasingtheefficiencyofdevelopment.Thisframeworkcansolvealotofproblems,withgoodmaintainabilityandscalability.Itcansolvetheseparationofuserinterfaceandbusinesslogicseparation,theseparationofbusinesslogicanddatabaseoperationandthecorrectprocedurecontrollogic,etc.Thispaperstudiest
6、hetechnologyandprincipleofStrutsandSpringandHibernate,presentingaprovedlightweightWEBapplicationframeworkforenterprise.HierarchicalWebMechanismHierarchicalWebframeworkincludingtheuserpresentationlayer,businesslogiclayer,datapersistencelayer,expansionlayeretc,eachlayerfordifferentfunction,respectivel
7、ytofinishthewholeapplication.Thewholesystemaredividedintodifferentlogicmodulewithrelativelyindependentandmutual,andeachmodulecanbeimplementedaccordingtodifferentdesign.Itcanrealizethesystemparalleldevelopment,rapidintegration,goodmaintainability,scalability.StrutsMVCFrameworkToensurethereuseandeffic
8、iencyofdevelopmentprocess,adoptingJ2EEtechnologytobuildtheWebapplicationmustselectasystemframeworkwhichhasagoodperformance.Onlyinthiswaycanweensurenotwastinglotsoftimebecauseofadjustingconfigurationandachieveapplicationdevelopmentefficientlyandquickly.So,programmersinthecourseofpracticegotsomesucces
9、sfuldevelopmentpatternwhichprovedpractical,suchasMVCandO/Rmapping,etc;manytechnologies,includingStrutsandHibernateframeworks,realizedthesepattern.However,Strutsframeworkonlysettledtheseparationproblembetweenviewlayerandbusinesslogiclayer,controllayer,didnotprovideaflexiblesupportforcomplexdatasaving
10、process.Onthecontrary,Hibernateframeworkofferedthepowerfulandflexiblesupportforcomplexdatasavingprocess.Therefore,howtointegratetwoframeworksandgetaflexible,low-couplingsolutionsprojectwhichiseasytomaintainforinformationsystem,isaresearchtaskwhichtheengineeringstaffisstudyingconstantly.Model-View-Co
11、ntroller(MVC)isapopulardesignpattern.Itdividestheinteractivesysteminthreecomponentsandeachofthemspecializesinonetask.Themodelcontainstheapplicationdataandmanagesthecorefunctionality.Thevisualdisplayofthemodelandthefeedbacktotheusersaremanagedbytheview.Thecontrollernotonlyinterpretstheinputsfromtheus
12、er,butalsodominatesthemodelandtheviewtochangeappropriately.MVCseparatesthesystemfunctionalityfromthesysteminterfacesoastoenhancethesystemscalabilityandmaintainability.StrutsisatypicalMVCframe32,anditalsocontainsthethreeaforementionedcomponents.ThemodelleveliscomposedofJavaBeanandEJBcomponents.Thecon
13、trollerisrealizedbyactionandActionServlet,andtheviewlayerconsistsofJSPfiles.Thecentralcontrollercontrolstheactionexecutionthatreceivesarequestandredirectsthisrequesttotheappropriatemodulecontroller.Subsequently,themodulecontrollerprocessestherequestandreturnsresultstothecentralcontrollerusingaJavaBe
14、anobject,whichstoresanyobjecttobepresentedintheviewlayerbyincludinganindicationtomoduleviewsthatmustbepresented.ThecentralcontrollerredirectsthereturnedJavaBeanobjecttothemainviewthatdisplaysitsinformation.SpringFrameworktechnologySpringisalightweightJ2EEapplicationdevelopmentframework,whichusesthem
15、odelofInversionofControl(IoC)toseparatetheactualapplicationfromtheConfigurationanddependentregulationsoftheapplication.CommittedtoJ2EEapplicationatalllevelsofthesolution,Springisnotattemptingtoreplacetheexistingframework,butrather“welding”theobjectofJ2EEapplicationatalllevelstogetherthroughthePOJOma
16、nagement.Inaddition,developersarefreetochooseSpringframeworkforsomeorall,sinceSpringmodulesarenottotallydependent.Asamajorbusiness-leveldetail,Springemploystheideaofdelayinjectiontoassemblecodeforthesakeofimprovingthescalabilityandflexibilityofbuiltsystems.Thus,thesystemsachieveacentralizedbusinessp
17、rocessingandreductionofcodereusethroughtheSpringAOPmodule.HibernatePersistentFrameworkHibernateisakindofopensourceframeworkwithDAOdesignpatternstoachievemapping(O/RMapping)betweenobjectandrelationaldatabase.DuringtheWebsystemdevelopment,thetraditionapproachdirectlyinteractswiththedatabasebyJDBC.Howe
18、ver,thismethodhasnotonlyheavyworkloadbut alsocomplexSQLcodesofJDBCwhichneedtorevisebecausethebusinesslogicslightlychanges.So,whateverdevelopmentormaintainsystemareinconvenient.Consideringthelargedifferencebetweentheobject-orientedrelationofjavaandthestructureofrelationaldatabase,itisnecessarytointro
19、duceadirectmappingmechanismbetweentheobjectanddatabase,whichthiskindofmappingshoulduseconfigurationfilesassoonaspossibility,sothatmappingfileswillneedmodifyingratherthanjavasourcecodeswhenthebusinesslogicchangesinthefuture.Therefore,O/Rmappingpatternemerges,whichhibernateisoneofthemostoutstandingrea
20、lizationofarchitecture.ItencapsulatesJDBCwithlightweight,makingJavaprogrammeroperatearelationaldatabasewiththeobjectorientedprogrammingthinking.Itisaaimplementationtechnologyinthelastinglayer.ComparedtootherlastinglayertechnologysuchasJDBC,EJB,JDO,Hibernateiseasytograspandmoreinlinewiththeobject-ori
21、entedprogrammingthinking.Hibernateownaquerylanguage(HQL),whichisfullyobject-oriented.Thebasicstructureinitsapplicationasshowninfigure6.1.Hibernateisadatapersistenceframework,andthecoretechnologyistheobject/relationaldatabasemapping(ORM).HibernateisgenerallyconsideredasabridgebetweenJavaapplicationsa
22、ndtherelationaldatabase,owingtoprovidingdurabledataservicesforapplicationsandallowingdeveloperstouseanobject-orientedapproachtothemanagementandmanipulationofrelationaldatabase.Furthermore,itfurnishesanobject-orientedquerylanguage-HQL.ResponsibleforthemappingbetweenthemajorcategoriesofJavaandtherelat
23、ionaldatabase,Hibernateisessentiallyamiddlewareprovidingdatabaseservices.Itsuppliesdurabledataservicesforapplicationsbyutilizingdatabasesandseveralprofiles,suchashibernatepropertiesandXMLMappingetc.Web services technologiesThe introduction of annotations into Java EE 5 makes it simple to create soph
24、isticated Web service endpoints and clients with less code and a shorter learning curve than was possible with earlier Java EE versions. Annotations first introduced in Java SE 5 are modifiers you can add to your code as metadata. They dont affect program semantics directly, but the compiler, develo
25、pment tools, and runtime libraries can process them to produce additional Java language source files, XML documents, or other artifacts and behavior that augment the code containing the annotations (see Resources). Later in the article, youll see how you can easily turn a regular Java class into a W
26、eb service by adding simple annotations.Web application technologiesJava EE 5 welcomes two major pieces of front-end technology JSF and JSTL into the specification to join the existing JavaServer Pages and Servlet specifications. JSF is a set of APIs that enable a component-based approach to user-in
27、terface development. JSTL is a set of tag libraries that support embedding procedural logic, access to JavaBeans, SQL commands, localized formatting instructions, and XML processing in JSPs. The most recent releases of JSF, JSTL, and JSP support a unified expression language (EL) that allows these t
28、echnologies to integrate more easily (see Resources).The cornerstone of Web services support in Java EE 5 is JAX-WS 2.0, which is a follow-on to JAX-RPC 1.1. Both of these technologies let you create RESTful and SOAP-based Web services without dealing directly with the tedium of XML processing and d
29、ata binding inherent to Web services. Developers are free to continue using JAX-RPC (which is still required of Java EE 5 containers), but migrating to JAX-WS is strongly recommended. Newcomers to Java Web services might as well skip JAX-RPC and head right for JAX-WS. That said, its good to know tha
30、t both of them support SOAP 1.1 over HTTP 1.1 and so are fully compatible: a JAX-WS Web services client can access a JAX-RPC Web services endpoint, and vice versa.The advantages of JAX-WS over JAX-RPC are compelling. JAX-WS: Supports the SOAP 1.2 standard (in addition to SOAP 1.1). Supports XML over
31、 HTTP. You can bypass SOAP if you wish. (See the article Use XML directly over HTTP for Web services (where appropriate) for more information.) Uses the Java Architecture for XML Binding (JAXB) for its data-mapping model. JAXB has complete support for XML schema and better performance (more on that
32、in a moment). Introduces a dynamic programming model for both server and client. The client model supports both a message-oriented and an asynchronous approach. Supports Message Transmission Optimization Mechanism (MTOM), a W3C recommendation for optimizing the transmission and format of a SOAP mess
33、age. Upgrades Web services interoperability (WS-I) support. (It supports Basic Profile 1.1; JAX-WS supports only Basic Profile 1.0.) Upgrades SOAP attachment support. (It uses the SOAP with Attachments API for Java SAAJ 1.3; JAX-WS supports only SAAJ 1.2.) You can learn more about the differences by
34、 reading the article JAX-RPC versus JAX-WS.The wsimport tool in JAX-WS automatically handles many of the mundane details of Web service development and integrates easily into a build processes in a cross-platform manner, freeing you to focus on the application logic that implements or uses a service
35、. It generates artifacts such as services, service endpoint interfaces (SEIs), asynchronous response code, exceptions based on WSDL faults, and Java classes bound to schema types by JAXB.JAX-WS also enables high-performing Web services. See Resources for a link to an article (Implementing High Perfo
36、rmance Web Services Using JAX-WS 2.0) presenting a benchmark study of equivalent Web service implementations based on the new JAX-WS stack (which uses two other Web services features in Java EE 5 JAXB and StAX) and a JAX-RPC stack available in J2EE 1.4. The study found 40% to 1000% performance incre
37、ases with JAX-WS in various functional areas under different loads.ConclusionEachframeworkhasitsadvantagesanddisadvantages.LightweightJ2EE structureintegratesStrutsandHibernateandSpringtechnology,makingfullusethepowerfuldataprocessingfunctionofStrutsandthemanagementflexibleofSpringandthematureofHibe
38、rnate.Accordingtothepractice,puttingforwardan open-sourcesolutionssuitableforsmallormedium-sizedenterpriseapplicationof.Theapplicationsystembasedonthisarchitecturetechnologydevelopmenthasinterlayerloosecoupling,structuredistinctly,shortdevelopmentcycle,maintainability.Inaddition,combinedwithcommerci
39、alprojectdevelopment,thesolutionhasachievedgoodeffect.Thelightweightframeworkmakestheparalleldevelopmentandmaintenanceforcommercialsystemconvenience,andcanpushforwardbecomeotherindustrybusinesssystemdevelopment.Throughresearchandpractice,wecaneasilyfindthatStruts/Spring/HibernateframeworkutilizesStr
40、utsmaturityinthepresentationlayer,flexibilityofSpringbusinessmanagementandconvenienceofHibernateintheserializationlayer,threekindsofframeworkintegratedintoawholesothatthedevelopmentandmaintenancebecamemoreconvenientandhandy.Thiskindofapproachalsowillplayakeyroleifapplyingotherbusinesssystem.Ofcourse
41、,howtooptimizesystemperformance,enhancetheusersaccessspeed,improvesecurityabilityofsystemframework,alloftheseworks,areneedtodoforauthorinthefurther.基于SSH框架实现的试题库管理系统小型或者中型企业的应用系统具有非常好的灵活性、安全性以及高性价比,传统的J2EE架构满足不了这些需求,但是基于SSH框架实现的应用系统更好的满足了这样的需求,这篇文章分析了关于SSH的一体化理论和关键技术,通过这些集成形成了轻量级Web框架,在已经集成三种技术的基础上,
42、伴随形成了基于SSH的轻量级Web 框架,并且在实际应用中有着重要作用。简介一般大型企业使用的是J2EE27平台,很好的解决了该应用的可靠性、安全性、稳定性,它的缺点是费用高、形成该系统的周期长,对于小型或者中型企业级应用,可以用轻量级Web代替系统框架,比如通用的Struts和Hibernate,随着Spring的广泛应用,轻量级Web框架开发的最好选择是Struts、Hibernate、Spring三者的相结合,因为它采用的是分层结构并且为Web应用程序在各层提供了一个框架的集成,这样不仅降低了层与层之间的耦合性,而且提高了开发效率。使用该框架可已经解决好多问题,具有可维护性和可扩展性,使
43、得用户接口和业务逻辑层之间分离,业务逻辑层、数据库访问层、以及程序控制层的分离等。本文研究了Struts、Hibernate以及Spring的技术和使用原则,呈现出企业级轻量级Web应用框架开发的权威性。网络分层机制网络分层主要分为:视图层、控制层、数据库持久层、拓展层等,使用每一层不同的功能完成整个应用程序。整个系统划分成相互独立、相互依存的不同逻辑 模块,根据具体设计调用不同的逻辑模块实现逐步实现该系统。同时实现系统并行开发、快速集成、可维护性、可扩展性。Struts MVC 框架为了确保高效率再次使用发展过程,采用J2EE技术去构建Web应用程序不许选择一个具有良好性能的框架,这使得我们
44、没有花费大量时间去进行系统配置,而是去高效率、快速地实现系统开发,因此程序员拥有很好的发展平台并且开发经验有了提升,如:MVC、O/R映射等。运用包括Struts、Hibernate这些技术框架实现这种模式。然而,Struts解决的是视图层、业务逻辑层、控制层之间的分离,对于那些错综复杂的数据保存没有提供灵活的支持。相反,Hibernate框架提供了强大且灵活的支持在保存错综复杂的数据时。因此工程人员正在研究使用框架并且灵活开发项目。 模型-视图-控制器,所谓的MVC是一种流行的设计模式。它把交互式系统中三种组成成分有一个明确的分工,各自负责自己的任务,MVC模型包含程序数据并且管理核心功能。
45、模型和反馈给用户的可视化显示由视图层管理,控制层要负责解释来自用户的输入,属于主导地位,也会通过对控制层的操作来改变视图层。MVC从系统页面的分离来提高系统的可扩展性和可维护性。Struts是典型的MVC框架,并且包含上述三层。模型级别由JavaBean和EJB组件构成,控制层通过ActionServlet的实现,视图层主要是JSP文件。ActionServlet执行JSP发出的请求,并重定向该请求到相应层进行继续处理。接着,控制层处理使用JavaBean对象,其存储任何视图层的数据通过来自页面的请求,并返回结果给控制层模块。控制层重定向返回的JavaBean对象,以显示其信息的主要内容。Sp
46、ring框架技术Spring是轻量级应用开发技框架,使用来自配置文件和应用程序的控制分离中的实际应用,依据J2EE应用所有的解决方案,Spring不仅是取代现有的技术,更是组织对象进行POJO管理。此外,开发人员可以自由使用Spring框架的部分或者全部,源于Spring模块不完全依赖。根据模块的业务描述,Spring采用加载延迟来提升代码的扩展性和内置系统的灵活性,该系统通过Spring Aop模块实现了集中业务处理,减少代码重用。Hibernate的持久层框架Hibernate持久层框架是一种用Dao设计模式实现对象和关系数据库之间映射的开源框架。随着网络系统的发展,传统的方法是使用JDB
47、C直接相连,这种方式使得系统工作负荷大而且SQL语句错综复杂,一旦业务逻辑发生变化,SQL语句就得做相应的修改,这样给开发者和维护人员带来不便,考虑了Java面向对象的关系与关系数据库存在很大差异性,介于对象和数据库之间引入配置文件进行之间映射,尽可能使用配置文件,只需要修改配置文件来代替Java源代码当业务逻辑有所改变时。因此,关系映射的出现,是Hibernate最优秀的实现建筑之一。Hibernate便捷的封装了JDBC,使得Java操作一个数据库与面向对象编程思维一致,它是一个持久层实现技术,比起其他持久层技术,如JDBC、EJB、JDO,Hibernate很容易掌握,更符合面向地向的编
48、程思路,Hibernate特有的完全面向对象的查询语言(HQL)。介于对象和关系数据库之间的映射是很关键的,Hibernate最本质的中间组件来提供服务,它通过利用数据库和多个配置文件,如Hibernate固有特性和XML映射等应用提供持久的数据服务.WEB服务技术在 Java EE 5 中引入了注解(annotation)特性,这简化了复杂 Web 服务端点和客户机的开发,与以前的 Java EE 版本相比,代码更少,学习过程更短了。注解(最早在 Java SE 5 中引入)是可以作为元数据添加到代码中的修饰性代码。它们并不直接影响程序的语义,但是编译器、开发工具和运行时库可以通过处理它们生
49、成额外的 Java 语言源文件、XML 文档或其他工件和行为,这些对包含注解的程序起辅助作用(参见 参考资料)。在本文后面,会看到如何通过添加简单的注解,将常规的 Java 类转换为 Web 服务。Web 应用程序技术除了现有的 JavaServer Pages 和 Servlet 规范,Java EE 5 引入了两种前端技术 JSF 和 JSTL。JSF 是一组 API,支持以基于组件的方式开发用户界面。JSTL 是一组标记库,支持在 JSP 中嵌入过程式逻辑、对 JavaBean 的访问方法、SQL 命令、本地化格式指令和 XML 处理。JSF、JSTL 和 JSP 的最新版本支持一种统一表达式语言(expression language,EL),这使这些技术更容易集成在一起(参见 参考资料)。 Web 服务支持方面的飞跃Java EE 5 中 Web 服务支持的基础是 JAX-WS 2.0,它是一种替代 JAX-RPC 1.1 的技术。这两种技术都支持创建 REST 风格和基于 SOAP 的 Web 服务,而不必直接处理 Web 服务固有的 XML 处理和数据绑定细节。开发人员可以继续使用 JAX-RPC(这仍然
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年广播媒体后期制作面试模拟题及解析
- 2025年机械设计试题及答案解析
- 2025年心电图师面试高频考点及模拟题
- 机电行业职业知识培训课件
- 2025年国际物流运营管理师资格考试试题及答案解析
- 2025年市政安全操作规范试题含答案
- 2025年机器人包装行业应用面试题
- 2025年宠物克隆师中级考试高频题预测
- 课件不允许录屏的原因
- 2025年高考真题-山东省高考真题地理试卷(含答案)
- 初中七年级数学备课组科研合作计划
- 《人工智能应用基础》 完整课件(共十个模块-上)
- 职业技术学院旅游管理专业《旅行社经营与管理》课程标准
- 奶茶店股份合作合同协议
- 2025-2030中国空气粒子计数器行业市场发展趋势与前景展望战略研究报告
- 立杆方法分类普通电杆的组立系列课件
- 四年级音标试卷及答案
- 学校食堂运营管理职责与分工
- 2025云南师范大学辅导员考试题库
- BEC商务英语(中级)阅读模拟试卷11(共405题)
- 语文课堂教学目标设计“四出发”
评论
0/150
提交评论