The pros and cons of Struts Hibernate and Springframeworks.docx

上传人:b****5 文档编号:28589438 上传时间:2023-07-19 格式:DOCX 页数:8 大小:19.86KB
下载 相关 举报
The pros and cons of Struts Hibernate and Springframeworks.docx_第1页
第1页 / 共8页
The pros and cons of Struts Hibernate and Springframeworks.docx_第2页
第2页 / 共8页
The pros and cons of Struts Hibernate and Springframeworks.docx_第3页
第3页 / 共8页
The pros and cons of Struts Hibernate and Springframeworks.docx_第4页
第4页 / 共8页
The pros and cons of Struts Hibernate and Springframeworks.docx_第5页
第5页 / 共8页
点击查看更多>>
下载资源
资源描述

The pros and cons of Struts Hibernate and Springframeworks.docx

《The pros and cons of Struts Hibernate and Springframeworks.docx》由会员分享,可在线阅读,更多相关《The pros and cons of Struts Hibernate and Springframeworks.docx(8页珍藏版)》请在冰豆网上搜索。

The pros and cons of Struts Hibernate and Springframeworks.docx

TheprosandconsofStrutsHibernateandSpringframeworks

TheprosandconsofStruts,Hibernate,andSpring3frameworks

Thestrutsframeworkhastheadvantagesofmodularity,flexibilityandreuse,whilesimplifyingthedevelopmentofMVCbasedwebapplications.

Advantages:

Struts,likemanyApacheprojectssuchasTomcatandTurbine,isopensourcesoftware,whichisoneofitsgreatadvantages.Enabledeveloperstolearnmoreabouttheirinternalimplementationmechanisms.

Beyondthat,thebenefitsofStrutsareprimarilyfocusedontwoaspects:

theTaglibandthepagenavigation.TheTaglibisataglibraryforStrutsthatisflexibleenoughtogreatlyimprovedevelopmentefficiency.Inaddition,asfarasthecurrentdomesticJSPdevelopersareconcerned,itisveryraretodevelopyourowntagsinadditiontothecommonlyusedtagsbroughtinbyJSP,andperhapsStrutsisagoodstartingpoint.

Asforpagenavigation,Ithinkthat'sgoingtobeadevelopmentinthefuture,infact,tomakethecontextofthesystemclearer.Byusingaconfigurationfile,youcangrasptheconnectionbetweenthepartsofthesystem,whichisofgreatbenefittolatermaintenance.Thisisespeciallytruewhenanotherdevelopertakesovertheproject.

Inaddition,strutsisanindustry"standard"(manysuccessfulcases),richinlearningresources,andexcellentHTMLtags

Disadvantages:

TaglibisoneoftheadvantagesofStruts,butforbeginners,butneedaprocessofcontinuouslearning,canevendisruptyourwebpageinthehabitofwriting,but,whenyougetusedtoit,youwillfeelit'sreallygood.

StrutssplittheControllerofMVCintothree,addingtothecomplexityofthesystemwhilegainingclarity.

ActionFormsisnotusedforunittesting(StrutsTestCasecanonlybeusedforintegration)

Struts,likemanyApacheprojectssuchasTomcatandTurbine,isopensourcesoftware,whichisoneofitsgreatadvantages.Enabledeveloperstolearnmoreabouttheirinternalimplementationmechanisms.TheStrutsopensourceframeworkwascreatedtomakeiteasierfordeveloperstobuildWebapplicationsbasedonJavaservletsandJavaServerPages(JSP)technologies.TheStrutsframeworkprovidesaunifiedstandardframeworkfortheopen,whichallowsdeveloperstofocusmoreonthebusinesslogicoftheapplicationbyusingStrutsasafoundation.TheStrutsframeworkitselfisamodel-view-controller(MVC)implementationusingJavaservletsandJavaServerPagestechnology.

Specifically,theadvantagesofStrutsare:

ImplementtheMVCpattern,andthestructureisclear,allowingdeveloperstofocusontheimplementationofthebusinesslogic.

Richtagscanbeused,andtheStrutstaglibrary(Taglib),ifflexible,cangreatlyimprovedevelopmentefficiency.Inaddition,asfarasthecurrentdomesticJSPdevelopersareconcerned,itisveryraretodevelopyourowntagsinadditiontothecommonlyusedtagsbroughtinbyJSP,andperhapsStrutsisagoodstartingpoint.

Pagenavigationisgoingtobeadevelopmentinthefuture,infact,tomakethecontextofthesystemclearer.Byusingaconfigurationfile,youcangrasptheconnectionbetweenthepartsofthesystem,whichisofgreatbenefittolatermaintenance.Thisisespeciallytruewhenanotherdevelopertakesovertheproject.

ProvideExceptionhandlingmechanisms.

Databaseconnectionpoolmanagement

6.SupporttheI18N

A,gotodisplaylayer,needtoconfigureforward,everytimegototheshowlayer,thatmostaredirectlytransferredtotheJSP,andinvolvesturning,needtoconfigureforward,iftherearetenshowstheJSPlayer,needtoconfigurethestruts,tentimesanddoesnotincludedirectoryandfilechanges,sometimesneedtomodifytheforward,notethateverychangeconfiguration,requesttoredeploythewholeproject,andtomcatethisserver,alsohavetorestarttheserver,ifthebusinesschangecomplexfrequentsystem,suchassimpleoperationunthinkable.Nowthat'sit,dozensofpeopleareusingoursystemonlineatthesametime,andyoucanimaginehowbigmyworriesare.

TheActionofStrutsmustbethread-safe,whichallowsonlyoneinstancetohandleallrequests.SoalltheresourcesthatactionUSESmustbesynchronized,whichraisestheissueofthread-safety.

EachActionofStrutsiscoupledwiththeWeblayer,sothatitstestsdependontheWebcontainer,andunittestsaredifficulttoimplement.However,aJunitextensiontool,StrutsTestCase,canimplementitsunittests.

Four,typeconversion.Struts'sFormBeanUSESallthedataasaStringtype,whichcanbetransformedusingthetoolCommons-Beanutils.

ButitstransformationisattheClasslevel,andthetypeoftransformationisunconfigurable.Theerrormessagereturnedtotheuserisalsoverydifficult.

5,thedependencyonservletsistoostrong.StrutsneedstorelyonServletRequestandServletResponsetohandleAction,andallitcan'tgetridoftheServletcontainer.

Thefront-endexpressionlanguageaspect.StrutsintegratesJSTL,soitmainlyUSEStheexpressionlanguageoftheJSTLtogetthedata.However,theexpressionlanguageoftheJSTLisveryweakintheCollectionandindexproperties.

7,thecontrolofActionexecutionisdifficult.StrutscreatesanActionanditwillbeverydifficulttocontrolitsexecutionorder.YoumayevenwanttorewritetheServlettoimplementyourfunctionalrequirements.

Eight,toActionbeforeandaftertreatment.TheStrutsprocessingwhentheActionisbasedontheclasshierarchies,itisdifficulttooperatedinActionbeforeandafterprocessing.

Nine,supportforeventsisnotenough.Inthestruts,isactuallyaFormtheFormcorrespondingtoanActionclass(orDispatchAction),inotherwords:

inthestrutsisactuallyaFormcorrespondingtoanevent,onlythestrutsthiseventiscalledapplicationevent,applicationeventandcomponentcomparedtotheeventisacoarse-grainedevents.

Strutsimportantactionformsformobjectisanobject,itrepresentsakindofapplication,thisobjectcontainsatleastafewfields,thesefieldsaretheJsppageintheforminputfield,asaformcorrespondingtoanevent,sothatwhenweneedtorefinetheeventgranularitytoforminthefield,thatis,afieldcorrespondingtoanevent,simplyusetheStrutsisunlikely,ofcourse,bycombiningturnJavaScriptcanbeimplemented.

2.Hibernate

Hibernateisanopensourceobject-relationalmappingframework,itisverylightweightforJDBCobjectencapsulation,maketheuseofJavaprogrammerscanfollowone'sinclinationstomanipulatethedatabaseobjectprogrammingthinking.

Hibernatecanbeusedinanysituation,usingtheJDBCcanintheJavaclientprogram,practical,andcanalsobeusedintheServlet/JSPWebapplication,themostrevolutionarysignificanceisthatHibernatecanreplacetheCMPinEJBofJ2EEapplicationarchitecture,tocompletetheimportanttaskofdatapersistence.

Mostdevelopmentorganizationsoftenadoptdatapersistencelayersthatcreateseparatedata.Oncetheunderlyingdatastructurechanges,thecostofadaptingtherestoftheapplicationtothischangewillbeenormous.Hibernatedulyfillsthisgap,providinganeasy-to-use,efficientobject-relationalmappingframeworkforJavaapplications.Hibernateisalightweightpersistenceframeworkthatisrichinfunctionality.

Advantages:

A.h.ibernateUSEStheJavareflectionmechanisminsteadofthebytecodeenhancementprogramtoachievetransparency.

B.Hibernate'sperformanceisexcellentbecauseit'salightweightframework.Theflexibilityofmappingisexcellent.

Itsupportsavarietyofrelationaldatabasesfromone-to-onetomany-to-manycomplexrelationships.

Cons:

itlimitstheobjectmodelyouuse.(forexample,apersistenceclassescannotbemappedintomultipletables)itsuniqueinterfaceandpoormarketsharealsodisturbing,nonetheless,Hibernateorwithitspowerfulmomentumtomitigatetheserisks.Otheropensourcepersistenceframeworksalsohavesome,butnoneofthemhaveamarketimpactlikeHibernate.

Abovepostalittlepassion,inthehopethatunderstanding,IloveyounotbecauseofsomepeoplecriticizetheHibernateanduncomfortable,butbecauseofwhoIaminsidethepostviewreallymademefeelridiculous.NomatterwhatyouthinkofHibernateasagoodthing,theonlythingI'msorryaboutisthatyoucan'tfindareallyhigh-levelevaluationofHibernateintheChineseBBS.OnTSShasahotaboutHibernatethread,withhundredsofpaste,includingHibernateauthorGavinandLiDOJDOCTO,forJDOandHibernatehadsomeheatedargument,Ihavethepatiencetoseeitagain,stillhavenotfoundtoHibernatereallypowerfulattack,theso-calledattackjusttoHibernatewithoutaGUIconfigurationtool,nocommercialcompanysupport,notstandardized,andsoontheseuntenablereason.

HerearesomeSuggestions:

One,HibernateisthelightweightobjectencapsulationofJDBC,anindependentobjectpersistencelayerframework,andAppServer,whichisnotnecessarilyassociatedwithejbs.HibernatecanbeusedinanysituationwhereJDBCcanbeused,

Forexample,thedatabaseaccesscodefortheJavaapplication,theimplementationclassfortheDAOinterface,andeventhecodeforaccessingthedatabaseinBMP.Inthatsense,HibernateandEBarenotacategorything,andthereisnosuchthingasaneither/orrelationship.

Second,HibernateisacloselyassociatedandJDBCframework,HibernatecompatibilityandJDBCdriver,andthedatabasehasacertainrelationship,andtheJavaprogramthatUSESit,however,doesn'thaveanythingtodowiththeAppServer,thereisnocompatibilityproblems.

Hibernatecan'tbeusedtocomparedirectlywithEntitybeans,onlyintheframeworkoftheentireJ2EEproject.Andeveninthewholesoftwareframework,Hiberna

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 人文社科 > 文学研究

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1