文档介绍:LinuxMagazineApril2004
ZenandtheAlrtofAspectOrientedProgramming
Aspectscangreatlystmplitydesignandmaintenanceefcomplexsystems
eyRonBodkinandRamnivasLaddad
ConsidertheffecydeofabpicalecommercepmojectFintyoumightdecideloarcitectyourcode
amoundanobjechelationalORappingIoostch%sJanaDaloObjeclorberateandJ2EE
servicessudhasserietsandlheJanaAullenicationandAuthorzatonServiceNexyoueate
interfacesanddlassesrepresentingbasinessconceptssudhs5aalslomenSKUsashoppingcant
inventonpandpaymentatthorationAtlhispointyourcodeisdleanandcompretensible
occursyouexaminethelogandundertandheseduenceofactvitestlaleadiothebug
ButbeforeyougetepatyourownbadkyouealtzelatparformanceatupIosuaffYouprofle
yourcodeTneedcadinglyouexdainYoumodifymanyassesoingoducecading吊hewhile
codeismessy,andheleanoulinesofyouroriginaldesignbegintobhr
ThissgacontintesmudlhesamewayforenorlandlingInactionnanagementbustnessnale
andsoonEvenifyoudusedafameworksuchasEtopriehiaBezngEJB,thesonywoalduttbe
mudhdffereatthewotkwouldsaroffalhtleeasierantlyoulaveIoventuebeyondle
boundariesofhefiamework
abeniceifthestuationwerediferentNeedlogging7Justwriteanewmodulehatlogslmetiod
executonNeedcadhingAddamoduleNeedsealriyAddanoltermodule张witioulmodiying
thecoreimplementaionleavingitascleanzsitwsdurtngheinitalplase
applicatonsbeterapprediateitbenefity
CrosseutingConcers
Intheypicalecommercesystenloggingcading,secuniy,enorlandiingtransactionmanagenent
concimencycontolandbuinessnilsimplenentationareansscuttingcopcensorequienentsand
desigoslementslhataffectmeltiplemodulesConventionalimplementationsofaossctingconcems
catsewopmblensnglingandscalteringTanglingoccurswtenapmogra