外文翻译使用开放源码工具的专业便携式开发文档格式.docx
《外文翻译使用开放源码工具的专业便携式开发文档格式.docx》由会员分享,可在线阅读,更多相关《外文翻译使用开放源码工具的专业便携式开发文档格式.docx(14页珍藏版)》请在冰豆网上搜索。
DesignPatternConsiderationsinYourPortalClearly,therearemanywaystoimplementadesignthatcannotbeexpressedadequatelyinthischapteralone.Hopefully,theintroductionofhigh-levelpatternconstructsandbriefdiscussionoftheimplementationofJavastandardsinthischaptercanfacilitateyourdesigndecisionsonyourportaldeployments.
Javalanguageandimplementationstandardscanalsohelpcontrolcomplexitysothatconsistentlevelsofqualitycanbeattainedinyourdevelopmentactivities.Thisinturncanleadtoincreasedpartneradoptionandportletmaintenance.Last,theadoptionofdesignpatternsshouldbeappliedsothatbestpracticesarepropagatedinyourportaldeploymentanddevelopmentoperationscanbehastened.
MuchhasbeenwrittenduringthelastfewyearsaboutdesignpatternsandtheiruseinJavadevelopment,soratherthangointogreatelaborationoftheiruse,wefeltthatitwouldbemorebeneficialtoprovidehigh-levelconceptsofpatternsthatmightbeusedinyourportaldeploymentsandtoencourageyoutoexplorethemfromtheonlineJavaworldnewsletterandfromtheCoreJ2EEPatternsbook[ALUR].
PlanningforPortalDeployment
UsingJavaStandards
Formanymission-criticaldevelopmentportalefforts,decisionsneedtobemadeaboutexpensivesoftwareprocurementstosatisfyyourdevelopmentneeds.Inordertoprotectthisinvestment,itiswisetoconsiderstandardswhenyoumakeyourpurchasingdecisionbecausethereisnothingworsethandumpingalotofmoneyintoaparticularframeworkonlytolearnafteryouhaveobtaineditthatitisaclosed,proprietarysystemthatdoesnotworkwellwithothersystems.Toguaranteethatthisdoesnothappentoyou,youshouldbecomefamiliarwithsoftwarestandardsandotherapplicationframeworks’useofthem.Regrettably,systemsthatdorelyheavilyonproprietaryextensionsoftenforceyourprojecttohireexpensiveexpertisetohelpyoudeployyourprogramwiththeirframework.
Figure7.21illustratessomeoftheJavastandardsthatcouldbeconsideredforportaldevelopment.Itisimportanttorememberthattheseneedtobeestablishedpriortoprocuringaportalframeworkorintegratingexistingapplicationsintoahomegrownportalapplication.AlwaysbecognizantofthelatestversionsofthestandardslistedinFigure7.21,andtheeffectsthatnewerversionsofthosestandardsmighthaveonyourdesigndecisions.
Figure7.21
Figure7.22illustratessomeoftheportalstandardsthatshouldbeconsideredbeforebuildingyourportalapplication.
Onmanyportalimplementations,abusinesscaseforadherencetolanguagestandardsthatrelatetoindividualportletsneedstobemadesothatproprietaryextensionsarenotadoptedbyaprogramthatdisallowscodereuseandpromotesvendorlock-in.Beingexposedtoproprietarydataformats,oneinevitablygetsincreasinglylockedintothesolutionsofaparticularvendor,whichinturnlimitstheoptionsforapplicationsoftware.Thisultimatelyenablesvendorstodictateenhancementpricesandintroducesunnecessaryriskstoyoursystem
Figure7.22
Model-View-Controller(MVC)Pattern
IntheportalarchitectureshowninFigure7.23,theMVCPatterniswheretheservletcontrollerrendersdifferentviewstotheportalfaç
adefromadisparatesetofdatasources.
Themodelisthepiecethathasnospecificknowledgeofitscontrollersoritsviews.Theportalsystemmaintainsrelationsbetweenthedifferentmodelsandviewsandbroadcastscontenttotheviewswhenthemodelchangesstate.Theviewistypicallythepiecethatmanagesthevisualizationsofthemodeldata.Thecontrolleristhepiecethatmanagesuserinteractionwiththemodeldata.
TheMVCPatternisusedwithmanyframeworksbecauseofitsabilitytohandlecontentdeliverycomplexitiesthatareprominentinmanyenterprisesystems.Jakarta’sStrutsandBEA’sWebFlowaretwonotableimplementationsthatusethisintheirframeworks.
TemplateMethodPattern
AgoodpracticewhendevelopingJavaBeansinyourportalapplicationsistousetheTemplateMethodPattern[GoF]toenforceacommondesignacrosstheportalback-end.TheTemplateMethodPatterncanbeusedsothatmodificationstoyourgetand/orsetmethodswillnotaffectyourpresentationview.
IntheportaldisplayinFigure7.23,theJavaBeanapplicationsontheback-endimplementtheTemplateMethodPatterntomanagethelogicintheaccessor(get/set)methods.
MementoPattern
InthesampleportalvisualizationshowninFigure7.23,theviewlabeled#4indicatesthataformwillberenderedtotheuserdisplay.Inmanycases,theformwilluseJavaScripttoperformvalidationtestingsothatactivitieswillbeperformedontheclientsideinordertoalleviateunnecessaryoperationsontheserver.ThisisagoodpracticeforsomeWebappl