SSh架构详解英文版.doc
《SSh架构详解英文版.doc》由会员分享,可在线阅读,更多相关《SSh架构详解英文版.doc(16页珍藏版)》请在冰豆网上搜索。
catalog
Abstract 3
1Introduction 3
2HierarchicalWebMechanism 4
3LightweightWebApplicationFramework 4
4StrutsMVCFramework 6
4.1Strutsworkmechanism 6
4.2Views 7
4.3Controller 7
4.4Model 7
5SpringFrameworktechnology 8
5.1SpringFramework 9
5.2mechanism 10
6HibernatePersistentFramework 10
7FrameworkApplicationAnalysis 12
8Conclusion 13
Acknowledgments 14
ApplicationoftheLightweightJ2EEFramework
BasedonSSH
Abstract
Theapplicationsystemfeaturesinsmallormedium-sizedenterpriselieinthegreaterflexibilityandsafetyhighperformance-priceratio.TraditionalJ2EEframeworkcannotadapttotheseneeds,butthesystemapplicationbasedonSSH(Struts+Spring+Hibernate)technologycanbettersatisfysuchneeds.ThispaperanalysessomeintegrationtheoryandkeytechnologiesaboutSSH,andaccordingtotheintegrationconstructsalightweightWEBframework,whichhasintegratedthethreekindsoftechnology,formingthelightweightWEBframeworkbasedonSSHandgaininggoodeffectsinpracticalapplications.
Keywords:
lightweight,webframework,J2EE,Struts,Spring,Hibernate
1Introduction
GenerallytheJ2EEplatform[27]usedinlargeenterpriseapplications,canwellsolvetheapplicationofreliability,safetyandstability,butitsweaknessisthepricehighandtheconstructingcycleislong.Correspondingtothesmallormediumenterpriseapplications,thereplaceapproachisthesystemframeworkoflightweightWEB,includingthemorecommonlyusedmethodswhicharebasedontheStrutsandHibernate.WiththewideapplicationofSpring,thethreetechnologycombinationmaybeabetterchoiceasalightweightWEBframework.ItuseslayeredstructureandprovidesagoodintegratedframeworkforWebapplicationsatalllevelsinminimizingtheInterlayercouplingandincreasingtheefficiencyofdevelopment.Thisframeworkcansolvealotofproblems,withgoodmaintainabilityandscalability.Itcansolvetheseparationofuserinterfaceandbusinesslogicseparation,theseparationofbusinesslogicanddatabaseoperationandthecorrectprocedurecontrollogic,etc.ThispaperstudiesthetechnologyandprincipleofStrutsandSpringandHibernate,presentingaprovedlightweightWEBapplicationframeworkforenterprise.
2HierarchicalWebMechanism
HierarchicalWebframeworkincludingtheuserpresentationlayer,businesslogiclayer,datapersistencelayer,expansionlayeretc,eachlayerfordifferentfunction,respectivelytofinishthewholeapplication.Thewholesystemaredividedintodifferentlogicmodulewithrelativelyindependentandmutual,andeachmodulecanbeimplementedaccordingtodifferentdesign.Itcanrealizethesystemparalleldevelopment,rapidintegration,goodmaintainability,scalability.Figure2.1isatypicallightweightJ2EEapplicationarchitecture.TheWebapplicationlayeredstructurebasicallyisdividedintothreelayers:
thepresentationlayer,businesslogiclayer,datapersistencelayer[28].
Figure2.1typicallightweightJ2EEframework
3LightweightWebApplicationFramework
IntheapplicationbasedonB/Sstructure,Strutsframeworkisusedtoimplementthepresentationlayer,andHibernateisusedtolastinglayer,andSpringisthecoreofthesystem.SpringintegratestheMVCframeworkofStrutsupwardandintegratestheORMframeworkdownward.TheIOCcontainermanagesthedependenciesbetweenthevariouscomponents.
Thedevelopmentpatterncombinedofthosethreekindstechnologyrealizesthefivelayersstructureofapplicationsystem,andconstructsaWebapplicationdevelopmentframework[29].Thisframeprocessingshowsasthefigure3.1.
Figure3.1SystemApplicationFramework
StrutsframeworkrealizedMVCdesignpatternsinthepresentationlayer[30].Inthepresentationlayer,thefunctionsofcontrollerachievedbyActionServletandActionMapping.ActionServletacceptsrequestsfromtheclient,andeachActionMappingrealizesmappingbetweenarequestandaspecificAction.
ViewrealizesbytheTagliboftheJSPpage.ModelrealizesbyActionandActionForm.ActionobjectcallsbusinesslogicmoduleinterfaceandsubmittheresponsetotherightViewcomponents.ActionFormcomponentobjectrealizesgooddataencapsulationforclientform,andrealizesmutualsupportbetweenViewandModel.BusinesslayerachievebyJavaBeanclass,includinginterfacesforActioncalling.TheseJavaBeanalsoencapsulatesHibernaterelationships.Businesslayerthroughdataconversionandpersistencelayertorealizeinteractionwithdatabaseresources.PersistencelayerrealizesbyHibernate.HibernateconvertHQLstatementsinJavaclasstoSQLstatements,andoperatedatasourceswithJDBCdriver,finishingdataoperationsuchasadd,delete,modify.Bottomisarelationaldatabase.
4StrutsMVCFramework
4.1Strutsw