SOABestPractices anddesignpatterns KeystoSuccessfulService Oriented ArchitectureImplementation JohnFronckowiak 4/3/2008 AwhitepaperexploringbestpracticesforSOA.
WhatAreOracleReal ApplicationClusters? Regardlessofbusinessmodel,every organizationhaschallengeswhenitcomesto offeringmultipleproductsandservices throughmultiplechannelstoalargecustomer base.moreandmoreorganizationsareturningtonewapproachesinbusinessprocessmanagementto solvethesechallenges. ExecutiveSummary ThereisnoquestionthatthesuccessfulimplementationofService OrientedArchitecture(SOA) reliesonacarefulandholisticapproachtobusinessplanning.oneofthemostimportanttoolsin theevaluation,purchase,andongoinguseofsoaisthebodyofbestpracticesthatvendors, consultants,andcustomershavecompiled.thepromiseofbusinessagility,improvedcustomer service,andcompetitiveadvantagewithsoaisreal.whatvariesmostisthetime,cost,andeaseof SOAimplementation.Bylearningfromtheexperiencesofthoseorganizationsthathavebeen throughtheprocessandlookingatthestandardbestpracticesoflarge scaletechnology implementations,successcancomeearlierandmoredramatically. BriefOverviewofSOA SOAsprovidemodularservicesthatcanbeeasilyintegratedthroughoutanenterprise.Theyare flexibleandadaptabletothecurrentinformationtechnology(it)infrastructureandinvestments. SOAimplementationscontinuetheiremergenceinbusinessasamechanismforintegrating organizationaloperationsinnewanddifferentwaysandforpromotingreusewhileleveragingthe existingvalueoflegacysystems. BenefitsofSOA Inanybusiness,thebottomlineistheessentialtestofanytechnology.SOAcanprovidea significantreturnoninvestment(roi)byintegratinglegacyandmixedtechnologiesandmaximizing thevalueofexistinginvestmentswhileminimizingrisk.promotingreusethroughsoaalsohelps reduceoveralldevelopmentcosts. Ifservicesandtheirdataaregenericenough,theycanbeaccessedthroughavarietyofinterfaces. Decouplingservicesfromtheirpresentationreducesexpensesanddecreasestheoverall developmenttime.further,soamakesitconsiderthedynamicoperationsofanorganization,not justasetofstaticrequirements,therebyexposinginformationanddatasharingacrossthe organizationandfocusingdevelopmentonthebestwaystoimproveoveralloperations. ChallengesofSOA AlthoughSOAbringssignificantbusinessbenefits,therearechallengestotheirimplementation.As SOAservicesaretypicallycoarse grainedandlooselycoupled,theiroperationsexhibitmorelatency thanmoretightlycoupledimplementations.thiscanbeachallengewhenimplementingwithrealtimerequirements.soaisdesignedtobringtogetherlegacysystemsinheterogeneousit environments.standardizationofnaming,definitions,andidentificationcanpresent implementationchallenges.however,thesechallengescanberesolvedbytheimplementationof identityandnamingservices. Finally,SOAisdesignedtocutthroughanorganizationhorizontallyandvertically,whichpresents manycultural,cooperation,ownership,andbudgetissues.strongleadershipmustbeinplace,and executivesupportmustbeclearandevidentinorderforanysoaimplementationtobeasuccess.
IntroductiontoBestPractices Bestpracticessuggestthatthereisanoverallcommitmenttoincreaseorganizationalefficiency.These practicesmustbeconsideredfromthespecificcontextofyourorganization.althoughthenotionofbest practicesisconstantlyevolving,it sclearthatthefollowingareasarecritical: Visionandleadership Strategyandroadmap Policiesandsecurity Governanceandacquisition Operationsandimplementation VisionandLeadership TheimplementationofService OrientedArchitecture(SOA)requiresvisionandleadershipfromthe organization sexecutives.thisleadershipisextremelyimportantinthefaceofculturalresistance, becauseuserswillbemovingfromacurrentcomfortzoneandwillneedtothinkandcooperatewith greatercross functionality.aclear,consistent,andrepeatedmessageofthebenefitsofthesoafrom executiveleadershipmakesitclearthattheyarecommittedtothesoaimplementation. AnevangelistshouldbeinplacetospreadthewordonSOAbenefitsandtolistenandrespondtousers criticisms.educationisthekey.theevangelistshouldpromotethevaluesininformationsharingacross theorganizationandshowhowdoingsoprovidestheabilitytoanswerthebiggerbusinessquestions. Theevangelistmustbesomeonewhounderstandsthebusiness,understandsthetechnologies,andhas theclearandstrongsupportofexecutivemanagement. SOAintroducesamodelthatcutsacrosstraditionalorganizationlinesandcanproducenewand valuableinformationandservices.thesoaimplementationshouldlookhorizontallyandvertically throughtheorganizationtofindvalueinthecurrentlyavailableresources.remember,soacanhelpyou leveragelegacysystemsandgetthemcommunicatinginwaystheyneverhavepreviously.certainly, therewillbedifferencestoovercome,andit simportanttoprovidetheappropriatelevelofsupportfor allstakeholders. MakingthebusinesscaseforSOAisimportantforgaininguniversalorganizationaladoption,whichis importantbothforexecutivemanagementandforsupportstaff.thebusinesscaseshouldincludethe objectives,aconsiderationofalternatives,afinancialanalysis,aprojectplan,andareviewoftheproject risksandassumptions.thebusinesscasewillhelptheorganizationmakethestrategiccaseforthesoa implementationand,whenwellpublicized,helptosocializetheplanwithintheorganization.eachofthe suborganizationsshouldbeassignedcleardeliverablesandwelldefinedsuccess factorstoensurethat thereisclearownershipandwell definedmetricsonthedeliverables.eachofthesesuborganizations shouldalsoberewardedforensuringsuccessoftheirdeliverablesaswellastheoverallsuccessofthe projectundertakings.finally,theplanalsoservesasatrackingdocumentandanobjective measurementofprojectsuccess.
StrategyandRoadmap ThestrategyandroadmapdocumentexplainsthegoalsandobjectivesoftheSOAimplementation.It shouldbeconsideredanevolvingdocumentthatwillchangeasyoumovethroughtheacquisitionsand implementationprocesses.thedocumentshouldaddressthearchitecturalviewofthedesignandalso includerisk,security,andmanagementconsiderations. TheSOAstrategyshouldbepublishedearlyintheSOAadoptionprocess.Thisstrategydocumentspells outtheintentionsandthoughtprocessofleadershipandisessentialforsocializingtheprocess throughoutthegreaterorganization.thestrategyshouldclearlyidentifyexpectedoutcomesofthe projectaswellasthemeasurementsthatwillbeusedtodeterminewhetheroutcomesaremet. SOAimplementationwillnottransformtheentireorganizationovernight,soit simportanttoplanforan incrementaldeployment.ideally,beginwiththelow hangingfruit:chooseahandfulofservicesthatwill makeadifferenceandthatpeoplewillnotice.successbreedssuccess andconfidence. Resourcesthatweretypicallystuckinorganizationalsilosinthepastwillnowbeexposedandshared acrosstheorganization.thisnewstructurewillrequirenewwaysofaccountingforthecostofthose resourcesthattheexecutiveleadershipmustsupport. Theorganizationisnotastaticentity,andtheSOAstrategyshouldreflectthat.Plananddesignfor change.newopportunitiesandchallengeswillarise,andtheplanshouldbereadytorisetothemand beflexibleenoughtoincorporatethem. Again,astheSOAimplementationcutsacrossorganizationalboundaries,terminologyanddefinitions willbedifferent.creatingacommonorganizationalvocabularyisimportantforprovidingashared understandingoftheservicesandinformationthatwillbeprovided.thisvocabularywillalsohelp facilitatefurtherinformationsharingandcollaborationacrosstheorganization. PoliciesandSecurity WhenthedecisionismadetoimplementSOA,aclearsetofpoliciesandserioussecurityconsiderations areinorder.thepoliciesmustclearlyidentifythemodelandarchitecturesthatwillbeimplemented acrosstheorganization.securityandriskmitigationmustalsobeassessed,andtheseconsiderations mustfeedbackintotheoverallpolicydecisions. It simportanttoadoptasetoftechnicalstandardsacrosstheorganization.recognizingthatstandards areconstantlychangingandevolving,it simportanttouseindustrypartnerstotrackdevelopments. Flexibilitywithchangesandcompliancewithasmanyemergingstandardsaspossiblearekeyto maximizingyoursoainvestment. SOAbringstogetherlooselycoupledservicestoprovidegreaterbusinessvalue.Manytimes,these servicesmaybeinastateofconstantchangeandflux.it simportanttoimplementaservicesdirectory, whichcatalogstheavailableservices.
Atop down,bottom upapproachiscriticaltosecurity.leadershipmustarticulatetheoverallsecurity policiesandrequirements,andusersandsystemownersmustactivelyimplementandpromotethose policies. Disaster recoveryplanningisessentialforanyproject.planforandimplementabusinesscontinuance plan.becausesoacutsacrossbusinessdomains,servicelevelagreements(slas)areimportantfor definingexpectationsfortheongoingavailabilityofservices. Securityshouldnotbeanafterthought;rather,itshouldbebakedintothesolutionfromthebeginning. Makesecurityandauthenticationpartoftheplanningprocesstomitigateriskexposures.It smuch easiertoincludesecurityinthesolutionfromthebeginningthantoadditafterimplementationis complete. Oftentimes,itisimportanttodrivethesecurity,risk,andcompliancepoliciesviaacentralteam.These policiesshouldthenbereferencedtofromallimplementationsofsoainyourenterprise.thisisthe recommendedwaytoenforcesecurityandcompliancerequirementsacrossyourorganization,no matterhowlargeorcomplexitmayget. GovernanceandAcquisitions GovernanceandacquisitionsmustworkcloselyforasuccessfulSOAimplementation.ImplementingSOA forthelowestcostpossible justtogetitdone willnotworkinthelongrun.boththegovernanceand theacquisitionsprocessmustbeflexibletomeetthemarket sfrequentchanges.organizationsmust participatewithstandardsbodiesandwithusercommunities(bothinternallyandexternally)toensure thatthemostappropriatechoicesaremade.governancemustembraceanopen standards,loosely coupled,modularserviceapproach. ExperimentwithpilotprojectstogainanunderstandingofSOA.Theseprojectsprovidetheexperience necessarytotacklelargerprojectsandexposethecross domainchallengesthatwillbeencountered. TheSOAimplementationplanmustbebuiltaroundincrementaladoption,acquisitions,and implementation.thisincrementalapproachwilleasethetransformationprocess,buttakecareto ensurethatthecurrentpurchaseswillmeetandintegratewithfuturedemands.thisiswhere adherencetoopenstandardsandparticipationinstandardsbodies(andwithusers)willbeofmost benefit. ImplementingSOAisadifferentwayoflookingattheoverallbusiness.Useenterprisemodelingto identifyanddocumentthebusinessinfrastructureandprocesses.definingthescopeandboundariesof businessprocessisimportant,andthisiswhereenterprisemodelingwillhelp. Finally,SOAwillincreaserelianceonthenetworkasthetransportandcommunicationmethodof services.it scriticaltohavefacilitiesinplacethatwillmonitor,measure,andanalyzethenetwork.use networkslastodefineexpectations.inaddition,ownershipofboththesoaservicedirectoryandof servicesmustbeclearlyidentifiedtokeepthedirectoryuptodate.
OperationsandImplementation Operationsandimplementationiswherealltheleadership,planning,anddesignareactualized.SOA implementationworksbestwithanagiledevelopmentapproach,inwhichservicesarebuilt incrementallybutinarapidfashion.it simportanttorecognize andbepreparedfor timeswhena servicebeingmovedtoyoursoamaybemetwithresistanceandskepticism,whichmayresultinlower qualityfortheveryshortterm.withadoptionandacceptancecomeincreasedeffectiveness,greatly increasingtheoverallservicequality. Aswithacquisitions,SOAcannotbeputinplaceovernight.Focusontheservicesthataretheeasiestto implementbutprovidethegreatestbusinessvalue.usethemasbuildingblocks.whenoneiscomplete, buildonthatservicetoimplementthenext.momentumiskey:whenyougetstarted,rideyoursuccess andacceptancetothenextphaseofimplementation.itisimportanttorecognizetheearlysuccessesof notonlytheprojects,buteventheinvolvedplayers.thisrecognitionandvisibilityearlyonwillboth encouragethealreadysuccessfulplayers,butalsoinspirethosewaitingonthesidelinestojointhe party. Partneringandcollaboration internallyandexternally intheimplementationphasehelpstomitigate risk.suchinteractionalsohastheaddedbenefitsofmaximizinginvestment,easingcross domain boundaryissues,andleveragingsharedexperiences. AkeybenefitofSOAisreuseofservices.It softentemptingtobuildsomethingfromscratchinsteadof reusingwhat salreadyavailable.thiscanoftenhappenfortworeasons.first,developersmaynotbe awarethatasimilarservicealreadyexists.therefore,it simportanttomaintainadirectoryofavailable servicesthatisreadilyaccessibleandusesthecommonvocabularyadoptedacrosstheorganization. Second,whendesigningandimplementingservices,theiruseoutsidetraditionalboundariesmustbe considered.creatingcoarse grained,modularserviceshelpstopromotetheirreuseintheorganization. Organizationsshouldnotcringefromupdatingservicesthathavealreadybeendeployedwhenthereare additionalneedsdemandingextensionoffunctionality.forexample,eventually,alltherequirements shouldbefactoredintoasingle getcustomer serviceratherthanhavingmultipleservicesthatget differentsubsetsofcustomerinformation. Finally,justgetstarted!Theoryandtalkonlygosofar.Beginwithsomething,anything!Keepinmind, though,thatthosepioneeringservicesmaybecomewidelyadoptedovertime,sodon tneglectthem. SOApromotesreuseofandinterdependenceonservices,soeventhoseearlyeffortsmustbecaredfor andmanaged. BriefOverviewofDesignPatterns Designpatternsarereusablesolutionstocommonsoftwaredesignproblems.Designpatternsspeedup thedevelopmentprocessthroughtheimplementationoftried and testedsolutions.theycanplayan importantroleinsoaimplementation,especiallyinthestandardizationofservicedesign.sincetheir introductioninthelate1980s,numerouspatternshavebeenrecognizedanddocumented.manysoa
implementationsusewebservices.itisimportantforarchitectsofsoaimplementationstohavean understandingofthefourprimarydesignpatternsforwebservices: Adapter:Promotesthereuseofexistingtechnologiesthroughwrappers,extendingyourexisting investments Façade:Usedtoreducethecouplingbetweentheclientandtheservercomponents anessential techniqueforcreatingtheappropriatelevelofgranularity Proxy:Providesanobjectsurrogate,usedtosimplifytheinteractionbetweenWebservices components Controller:AkeycomponentoftheModel View Controller(MVC)architecture,usedasan intermediarybetweentheuserinterface(ui)andthedata Adapter Aspreviouslydiscussed,promotingthereuseofexistingtechnologiesisessentialforasuccessful and profitable SOAimplementation.TheAdapterdesignpattern,showninFigure1,allowsotherwiseincompatibleclassestoworktogetherbyconvertingtheinterfaceofanexistingclassintoaninterface thatclientsexpect. ERPor Legacy System AdapterJCA Client Figure1.TheAdapterdesignpattern OrganizationswilllooktoreuseexistingtechnologiesintheirSOAimplementations;thisiswhere theadapterpatternisimplemented.typically,existingtechnologiesprovideinterfacesthatare incompatiblewithwebservices.theadapterpatternprovidesabridgetotheexistingtechnology. Youdon thavetostartfromscratchwhendesigningwebservices:theadapterpatterncanleverage yourexistinginvestmentandquicklygetyoustartedontheroadtoserviceimplementation.however, it simportanttorealizethatnoteveryapplicationmaybeausefulservice.it simportanttobejudicious inyourdesign. Façade Providingtheappropriatelevelofgranularityisessentialtoservicedesign.Servicesthataretoofinegrainedcanincreasetheoverallnetworktrafficasmanyservicerequestsaremadetoperforman operation.morecoarse grainedservicescanincreaseoveralllatency,buttheyhelpexposeservicesthat exposeabusinessfunction.
TheFaçadepattern,showninFigure2,isoftenusedtoexposecoarse grainedservices.insteadof exposingthedirect,one to onefunctionalityofanexistingsoftwarecomponentorbusinessfunction, thefaçadepatternpromotesencapsulationoftheselower levelservicestoprovideasinglehigher level function. Client Mortgage Application IsEligible Bank HasSuficientSavings Figure2.TheFaçadedesignpattern Credit HasNoBAdLoans Loan HasNoBadLoans TheFaçadepatternpromotesconsistentinterfaces,abstractingclientsfromtheimplementationdetails ofaservice.further,thepatternfacilitatescontrolandmanagementofaservice,providingasingle entrypointthatsimplifieselementssuchassecurityandtransactionmanagement. Proxy TheProxydesignpattern,showninFigure3,providesasurrogateorplaceholderforanotherobject.It canbeusedtosimplifytheinteractionsamongservices.theproxycanserveasastandardizedinterface foracollectionoflegacyback endservices.inotherwords,insteadofprovidingaserviceforeach individualback endservice,youcanusetheproxytoconsolidatethemessagesintoasingleservice, thendispatchtherequesttotheappropriateback endservice,whichsimplifiestheinteractionwitha collectionofservices.
Client Customer Proxy NorthAmerica Europe Asia Customer getcustomerdata Customer getcustomerdata Customer getcustomerdata Figure3.TheProxydesignpattern TheProxydesignpatterncanalsobeusedfortesting,especiallywhenyouarecommunicatingwitha third partyobjectthatyoudonotcontrol.theproxywouldimplementthesameinterfaceasthethirdpartyserviceandcanstandinitsplaceduringthetestingprocess.again,thissimplifiesthetesting process. Controller TheControllerdesignpattern,showninFigure4,isprobablybestknownfromtheMVCapplication architecture.inthemvcarchitecture,themodelcontainsthedatathattheapplicationrequires;the viewmanagestheuseruis;andthecontrollerprovidesthelogicandservesastheinterfacebetweenthe modelandtheview.thecontrollerdesignpatternisusedtoseparatethepresentationanddatalayers.
Controller View Model Figure4.TheControllerdesignpattern TheControllerdesignpatterncanbeusedinSOAarchitecturestoleverageexistingapplicationMVC designarchitecturesandencapsulatethebusinesslogicoftheservice. ApproachingBestPractices SOAbestpracticesareconstantlyevolving.However,effortsmustbemadeineachoftheareas discussed:visionandleadership,strategyandroadmap,policiesandsecurity,governanceand acquisition,andoperationsandimplementation.havingachampionwhohasagoodunderstandingof SOAandcancommunicatethatvisiontoallthestakeholdersisessentialtoasuccessfulimplementation. Lookforthelow hangingfruitasyoubeginyoursoaimplementation.dosomething!establishsuccess withaproject;learnfromyourmistakesaswellasfromyoursuccess.anincrementalandagile approachwillbeessential. GettingStartedwithDesignPatterns Whetherdesignpatternsareafamiliartooloranewconcept,anunderstandingofthefourkeydesign patterns Adapter,Façade,Proxy,andController willbeessentialtoyoursoaimplementation.begin withindentifyingtheservicesyouneedtoimplement,andthenlooktoseehowtheyfitintooneof thesepatterns.soon,you llbeabletoeasilyrecognizehowaservicecanbeimplementedusingthese triedandtruepatterns,andthatwillgiveyouanupperhandinthecriticalprocessofservice standardization. Resources ThisarticleisastartingpointforunderstandingSOAbestpracticesanddesignpatterns.Thefollowing additionalresourceswillhelpyougainadeeperunderstanding: Oracle ssoaresourcecenterathttp://www.oracle.com/technologies/soa/center.html