关闭

关闭

关闭

封号提示

内容

首页 POJOs.in.Action.pdf

POJOs.in.Action.pdf

POJOs.in.Action.pdf

上传者: zongquanliu 2012-04-02 评分 0 0 0 0 0 0 暂无简介 简介 举报

简介:本文档为《POJOs.in.Actionpdf》,可适用于IT/计算机领域,主题内容包含FROMOURPEERREVIEW“ChrenteplesArchbyEexamciateningand“TconstoinobjeSpri“Tar符等。

FROMOURPEERREVIEW“ChrenteplesArchbyEexamciateningand“TconstoinobjeSpri“Tarchcantcomcont“POJthetJEEorieJohnJEEfore‘Wh“TbookisRichardsontargetscriticaldesignissuesforlightweightJavarpriseapplicationsusingPOJOswithfantasticindepthexamThisbookextendsMartinFowler’sgreatbook,EnterpriseitecturePatterns,aswellasthemorerecentDomainDrivenDesignricEvans,byprovidingpracticaldesignguidanceandusefulplesItalsoaddressesthearchitectureanddesignissuesassodwithSpringandHibernatedevelopment,whereasMan’scompanion‘inAction’booksfocusprimarilyontheSpringHibernatetechnologieshisisapowerfulbookforarchitects,seniordevelopers,andultantsItuniquelycombinesbestpracticesanddesignwisdomtegratedomaindrivendesignandtestdrivendevelopmentforctorientedJavaenterpriseapplicationsusinglightweightng,Hibernate,andJDOtechnologieshetableofcontentsreflectstheimportanttopicsthatmostitectsandenterprisedevelopersfaceeverydayThereissignifineedforabooklikethis,whichshowshowtoaddressmanymonandcomplexdesignissueswithrealworldexamplesTheentinthisbookisuniqueandnotreallyavailableelsewhere”DOUGWARRENSoftwareArchitectCountrywideFinancialOsinActionfillsavoid:theneedforapracticalexplanationofechniquesusedatvariouslevelsforthesuccessfulbuildingofprojectsThisbookcanbecomparedwiththelessenterprisentedandmoreabstractJEEDevelopmentwithoutEJBbyRodson,butRichardsonoffersastepbystepguidetoasuccessfulprojectTheexplanationsofthevariousalternativesavailableachstepprovidethemainthrustofthisbookAlso,thevariousentouseit’paragraphsarehelpfulinmakingchoiceshe‘lightweightJEE’pointofviewisveryunderrepresentedinsandthisoneisthemostdidacticJEElightbookIhaveread”OLIVIERJOLLYJEEArchitectInterfaceSI“POJOsinActionprovidesgoodcoverageofthecurrentEJBandPOJOdiscussionsinthedevelopercommunityThebookiseasytoreadandhaslotsofgoodexamplesItprovidesacompletediscussionofthesubjectmatter,fromthebasicdatadefinitionstotheitake“Tmosofptionmaywhehave“CwhicattemWhithecomPOJOduptechmplicationsontheclientside:Ihaven’tseenanotherbookthatsthisapproach,soitdefinitelyfillsanicheheauthordescribessometechnologiesasbeingunsuitablefortsituations,butstickstohisgunsandmaintainsthephilosophyrovidingtheuserwithachoice,describingeachpossiblesoluindepth,despitepreviousassertionsthataparticularsolutionbesuboptimalThisreflectstherealitiesinadeveloper’sworld,reweareoftenforcedtousetechnologiesthatwemightnotchosenourselves:thissupportisAGoodThingomparedtoMartinFowler’sEnterpriseArchitecturePatterns,hprovidesageneralizeddescriptionoftheenterprise,thisbookptstopresentthesolutionstothesituationsFowlerdescribeslemuchoftheinformationcanbefoundelsewhere,includingwebsitesforthetechnologiesaswellasFowler’sbook,thebinationoffocusedinformationandtheexplicitsamplesmakessinActionmuchmorethanthesumofitspartsItisn’tmerelyalicationofwhat’savailableelsewhere:itcarefullyexplainsthenologieswithplentyofsamplecode,inaconsistentstyle”BRENDANMURRAYSeniorSoftwareArchitectIBMPOJOsinActionDEVELOPINGENTERPRISEAPPLICATIONSWITHLIGHTWEIGHTFRAMEWORKSCHRISRICHARDSONMANNINGGreenwich(wlong)ForonlineinformationandorderingofthisandotherManningbooks,pleasevisitwwwmanningcomThepublisheroffersdiscountsonthisbookwhenorderedinquantityFormoreinformation,pleasecontact:SpecialSalesDepartmentManningPublicationsCoBruceParkAvenueFax:()Greenwich,CTemail:manningmanningcombyChrisRNopartofthispuinanyformorbypriorwrittenpermManyofthedesigareclaimedastraPublicationswasacapsorallcapsRecognizingtheithebookstheypuManningPBrucePGreenwichISBNPrintedintheUnichardsonAllrightsreservedblicationmaybereproduced,storedinaretrievalsystem,ortransmitted,meanselectronic,mechanical,photocopying,orotherwise,withoutissionofthepublishernationsusedbymanufacturersandsellerstodistinguishtheirproductsdemarksWherethosedesignationsappearinthebook,andManningwareofatrademarkclaim,thedesignationshavebeenprintedininitialmportanceofpreservingwhathasbeenwritten,itisManning’spolicytohaveblishprintedonacidfreepaper,andweexertourbesteffortstothatendublicationsCoCopyeditor:LizWelcharkAvenueTypesetter:GordanSalinovic,CTCoverdesigner:LeslieHaimesitedStatesofAmerica–VHG–Tomymum,mydad,andmygrandparentsThankyouforeverythingmmmmmmmmmmmmmmmmmmmmmmmmmmmCRPARTFFFFFFFFFFChapterChapterPARTChapterChapterChapterChapterChapterPARTChapterChapterChapterbriefcontentsOVERVIEWOFPOJOSANDLIGHTWEIGHTFFFFFFRAMEWORKSDevelopingwithPOJOs:fasterandeasierJEEdesigndecisionsASIMPLER,FASTERAPPROACHUsingtheDomainModelpatternOverviewofpersistingadomainmodelPersistingadomainmodelwithJDOPersistingadomainmodelwithHibernateEncapsulatingthebusinesslogicwithaPOJOfaçadeVARIATIONSUsinganexposeddomainmodelUsingtheTransactionScriptpatternviiImplementingPOJOswithEJBviiiBRIEFCONTENTSPARTDEALINGWITHDATABASESANDCCCCCCCCCCCCCONCURRENCYChapterImplementingdynamicpagedqueriesChapterChapterDatabasetransactionsandconcurrencyUsingofflinelockingpatternsPARTLLLLLLLLLcontentsprefacexixacknowledgmentsxxiaboutthisbookxxiiiaboutthetitlexxxaboutthecoverillustrationxxxiOVERVIEWOFPOJOSANDLLIGHTWEIGHTFRAMEWORKSDevelopingwithPOJOs:fasterandeasierThedisillusionmentwithEJBsAbriefhistoryofEJBsAtypicalEJBapplicationarchitectureTheproblemswithEJBsEJBisastepintherightdirectionDevelopingwithPOJOsUsinganobjectorienteddesignUsingPOJOsPersistingPOJOsEliminatingDTOsMakingPOJOstransactionalConfiguringapplicationswithSpringDeployingaPOJOapplicationPOJOdesignsummaryixSummaryxCONTENTSJEEdesigndecisionsBusinesslogicanddatabaseaccessdecisionsDecision:organizingthebusinesslogicPARTUsingaproceduraldesignUsinganobjectorienteddesignTableModulepatternDecision:encapsulatingthebusinesslogicEJBsessionfaçadePOJOfaçadeExposedDomainModelpatternDecision:accessingthedatabaseWhat’swrongwithusingJDBCdirectlyUsingiBATISUsingapersistenceframeworkDecision:handlingconcurrencyindatabasetransactionsIsolateddatabasetransactionsOptimisticlockingPessimisticlockingDecision:handlingconcurrencyinlongtransactionsOptimisticOfflineLockpatternPessimisticOfflineLockpatternMakingdesigndecisionsonaprojectOverviewoftheexampleapplicationMakinghighleveldesigndecisionsMakingusecase–leveldecisionsSummaryASIMPLER,FASTERAPPROACHUsingtheDomainModelpatternUnderstandingtheDomainModelpatternWherethedomainmodelfitsintotheoverallarchitectureAnexampledomainmodelRolesinthedomainmodelDevelopingadomainmodelIdentifyingclasses,attributes,andrelationshipsAddingbehaviortothedomainmodelCONTENTSxiImplementingadomainmodel:anexampleImplementingadomainservicemethodImplementingadomainentitymethodSummaryofthedesignSummaryOverviewofpersistingadomainmodelMappinganobjectmodeltoadatabaseMappingclassesMappingobjectrelationshipsMappinginheritanceManagingobjectlifecyclesPersistentobjectidentityOverviewofORMframeworksWhyyoudon’twanttopersistobjectsyourselfThekeyfeaturesofanORMframeworkBenefitsanddrawbacksofusinganORMframeworkOverviewofJDOandHibernateDeclarativemappingbetweentheobjectmodelandtheschemaAPIforcreating,reading,updating,anddeletingobjectsQuerylanguageSupportfortransactionsLazyandeagerloadingObjectcachingDetachedobjectsHibernatevsJDODesigningrepositorieswithSpringImplementingJDOandHibernaterepositoriesUsingtheSpringORMclassesMakingrepositorieseasiertotestTestingapersistentdomainmodelObjectrelationaltestingstrategiesTestingagainstthedatabaseTestingwithoutthedatabaseOverviewofORMUnitPerformancetuningJDOandHibernateWithoutanytuningConfiguringeagerloadingUsingaprocesslevelcacheUsingthequerycacheTheexampleschemaSummaryPersistingadomainmodelwithJDOJDOissuesandlimitationsConfiguringJDOobjectidentityPersistinginterfacesUsingtheJDOenhancerxiiCONTENTSPersistingadomainmodelclasswithJDOWritingJDOpersistencetestswithORMUnitTestingpersistentJDOobjectsMakingaclasspersistentImplementingtheJDOrepositoriesWritingamockobjecttestforfindRestaurants()ImplementingJDORestaurantRepositoryImplWritingthequerythatfindstherestaurantsWritingtestsforaqueryJDOperformancetuningUsingfetchgroupstooptimizeobjectloadingUsingaPersistenceManagerFactorylevelcacheUsingaquerycacheSummaryPersistingadomainmodelwithHibernateHibernateORMissuesFieldsorpropertiesHibernateentitiesandcomponentsConfiguringobjectidentityUsingthecascadeattributePersistinginterfacesOtherHibernateissuesExceptionhandlingLazyloadingandinheritancehierarchiesPersistingadomainmodelclassusingHibernateWritingHibernatepersistencetestswithORMUnitTestingpersistentHibernateobjectsMakingaclasspersistentImplementingarepositoryusingHibernateWritingamockobjecttestforarepositorymethodImplementingHibernateRestaurantRepositoryImplWritingthequerythatfindstherestaurantsWritingtestsforaqueryHibernateperformancetuningUsingeagerloadingUsingaprocesslevelcacheUsingaquerycacheSummaryEncapsulatingthebusinesslogicwithaPOJOfaçadeOverviewofaPOJOfaçadeAnexamplePOJOfaçadeBenefitsofaPOJOfaçadeDrawbacksofaPOJOfaçadeWhentouseaPOJOfaçadeanddetacheddomainobjectsCONTENTSxiiiPOJOfaçadedesigndecisionsEncapsulatingthedomainobjectsDetachingobjectsExceptionsversusstatuscodesManagingtransactionsandconnectionsImplementingsecurityPARTSupportingremoteclientsDesigningaPOJOfaçade’sinterfaceDeterminingthemethodsignaturesImplementingthePOJOfaçadeWritingatestforaPOJOfaçademethodImplementingupdateRestaurant()ImplementingaresultfactoryImplementingaHibernateresultfactoryImplementingaJDOresultfactoryDeployingthePOJOfaçadewithSpringGenericbeandefinitionsJDOspecificbeandefinitionsHibernatebeandefinitionsSummaryVARIATIONSUsinganexposeddomainmodelOverviewoftheExposedDomainModelpatternApplyingtheExposedDomainModelpatternBenefitsanddrawbacksofthispatternWhentousetheExposedDomainModelpatternManagingconnectionsusingaSpringfilterManagingtransactionsManagingtransactionsinthepresentationtierManagingtransactionsinthebusinesstierAnexampleoftheExposedDomainModelpatternServletdesignJSPpagedesignPlaceOrderServiceconfigurationUsingJDOwithanexposeddomainmodelDefiningtheSpringbeansConfiguringthewebapplicationxivCONTENTSUsingHibernatewithanexposeddomainmodelDefiningtheSpringbeansConfiguringthewebapplicationSummaryUsingtheTransactionScriptpatternOverviewoftheTransactionScriptpatternApplyingtheTransactionScriptpatternBenefitsanddrawbacksoftheTransactionScriptpatternWhentousetheTransactionScriptpatternIdentifyingthetransactionscriptsAnalyzingtheusecaseAnalyzingtheuserinterfacedesignThePlaceOrderTransactionScriptsinterfaceImplementingaPOJOtransactionscriptWritingatestforthetransactionscriptWritingthetransactionscriptImplementingtheDAOswithiBATISandSpringOverviewofusingiBATISwithSpringImplementingaDAOmethodConfiguringthetransactionscriptsusingSpringHowSpringmanagesJDBCconnectionsandtransactionsTheSpringbeandefinitionsSummaryImplementingPOJOswithEJBOverviewofEJBKeyimprovementsinEJBKeylimitationsofEJBImplementingadomainmodelwithEJBMappingtheclassestothedatabaseImplementingrepositoriesTestingthepersistentEJBdomainmodelImplementingafaçadewithEJBTurningaPOJOfaçadeintoasessionbeanDetachingobjectsAssemblingthecomponentsUsingEJBdependencyinjectionIntegratingSpringandEJBdependencyinjectionUsingSpringdependencyinjectionCONTENTSxvImplementingotherpatternswithEJBImplementingtheExposedDomainModelpatternImplementingtheTransactionScriptpatternImplementingdynamicpagedqueriesImplementingtheconcurrencypatternsPARTAAAAAAAAASummaryDEALINGWITHDATABASESANDCONCURRENCYImplementingdynamicpagedqueriesKeydesignissuesImplementingapagingmechanismGeneratingqueriesdynamicallyImprovingtheperformanceofSQLqueriesImplementingdynamicpagedquerieswithiBATISUsingqueryForList()toselecttherowsUsingROWNUMtoselecttherowsImplementingpagedquerieswithJDOandHibernateGeneratingHibernateandJDOqueriesdynamicallyLoadingthedatawithasingleSELECTstatementLoadingasubsetofanobject’sfieldsWorkingwithadenormalizedschemaImplementingpagingAJDOdesignexampleTheJDOOrderRepositoryImplclassTheExecuteFindOrdersQueryclassAHibernatedesignexampleTheHibernateOrderRepositoryImplclassTheFindOrdersHibernateCallbackclassUsingJDOandHibernatenativeSQLqueriesUsingJDOnativeSQLqueriesUsingHibernateSQLqueriesSummaryxviCONTENTSDatabasetransactionsandconcurrencyHandlingconcurrentaccesstoshareddataUsingfullyisolatedtransactionsOptimisticlockingPessimisticlockingUsingacombinationoflockingmechanismsHandlingconcurrentupdatesinaJDBCiBATISapplicationDesignoverviewUsingoptimisticlockingUsingpessimisticlockingUsingserializableorrepeatablereadtransactionsSignalingconcurrentupdatefailuresHandlingconcurrentupdateswithJDOandHibernateExampledomainmodeldesignHandlingconcurrentupdateswithJDOHandlingconcurrentupdateswithHibernateRecoveringfromdataconcurrencyfailuresUsinganAOPinterceptortoretrytransactionsConfiguringtheAOPinterceptorSummaryUsingofflinelockingpatternsTheneedforofflinelockingAnexampleofaneditstyleusecaseHandlingconcurrencyinaneditstyleusecaseOverviewoftheOptimisticOfflineLockpatternApplyingtheOptimisticOfflineLockpatternBenefitsanddrawbacksWhentousethispatternOptimisticofflinelockingwithJDOandHibernateUsingversionnumbersortimestampsUsingdetachedobjectsOptimisticofflinelockingwithdetachedobjectsexampleImplementingthedomainserviceImplementingthepersistentdomainclassDetachingandattachingordersThePessimisticOfflineLockpatternMotivationUsingthePessimisticOfflineLockpatternBenefitsanddrawbacksWhentousethispatternCONTENTSxviiPessimisticofflinelockingdesigndecisionsDecidingwhattolockDeterminingwhentolockandunlockthedataChoosingthetypeoflockIdentifyingthelockownerMaintainingthelocksHandlinglockingfailuresUsingpessimisticofflinelockinginadomainmodelImplementingalockmanagerwithiBATISImplementingthedomainserviceAdaptingtheotherusecasesSummaryreferencesindexBackintionswthosefrtobektiontiesessionUsingPdeployeandEJBIronthatIspleofrwhynoAnotheweretwthemfoierIfoserverHibsionbeThesopreface,IenthusiasticallyembracedJEEandstarteddevelopingapplicaithservlets,JSPpages,andEJBsEventhoughIwasanuncriticalfanofameworks,IfoundthatIcouldsimplifydevelopmentbyusingwhatcamenownas“PlainOldJavaObjects”(POJOs)Forexample,inthepresentarIwroteservletsthatdelegatedtoPOJOsAndinthebusinesstierIwrotebeansthatdelegatedtoPOJOsandentitybeansthatextendedPOJOsOJOsenabledmetotestmycodewithouthavingtowaitforittobedintheserverBecausePOJOswerenotdirectlysupportedbytheservletframeworks,however,Ihadtojumpthroughafewhoopstousethemically,itwasn’tuntilafterwritinganarticledescribingsomeofthosehoopstartedtouselightweightframeworkswhichsupportPOJOsdirectlyAcoueadercommentswerealongthelinesof“WhybotherwithentitybeanstuseanobjectrelationalmappingframeworkinsteadIt'salotsimpler”rreadersuggestedusingHibernateandanothersuggestedJDO,whichotechnologiesthatIwasonlyvaguelyawareofAfterexperimentingwithracoupleofweeks,IrealizedthattheymadepersistingobjectsaloteasundIcoulddevelopandtestmostofthebusinesslogicoutsideoftheIwashooked!ernateandJDOreplacedentitybeans,butwhattodoaboutthosepeskysesxixansTheyneed

用户评论(0)

0/200

精彩专题

上传我的资料

每篇奖励 +2积分

资料评价:

/49
仅支持在线阅读

意见
反馈

立即扫码关注

爱问共享资料微信公众号

返回
顶部