资源描述:
《Using Design Patterns to Implement Object-Oriented Menus in a 英文》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、ApplicationsDevelopmentUsingDesignPatternstoImplementObject-OrientedMenusinaSAS/AFÒApplicationJackE.Fuller,TrilogyConsultingCorporation,Kalamazoo,MIABSTRACTselectiontothecodewhichwillbeexecuted;third,amethodforeasilyextendingthissystemOneofthemorefrustratingaspectsofdesigningtotheuniquer
2、equirementsofdifferentaGraphicalUserInterface(GUI)forSAS/AFapplications.applicationsliesinthebasicdifficultyofreconcilingobject-orientedprogrammingBUILDINGTHEMIRRORtechniqueswithSASÒsoftware’spmenus.Fundamentalobject-orientedconceptssuchasABoxInsideaBoxInsideaBoxInside…encapsulationandpo
3、lymorphismarenotbuiltFromastructuralperspective,apmenucanbeintopmenus.thoughtofassimplyatree.Forexample,apartiallyconstructedtreeofSASsoftware’sThispaperintroducesdesign-patternstobuildwindowpmenuwouldlooklikeasfollows:constructasystemthatbringspmenusintotherealmofobject-orientedprogramm
4、ing.ThekeyPmenuconceptisthatwhileaframestillrequiresatraditionalpmenuformenuing,allprogramminginteractionsarenowroutedthroughacorrespondingnon-visualobjectViewFileLocalsstructurewhichmirrorsthepmenuandprovidestheencapsulationandpolymorphismwhichwerepreviouslymissingfrompmenus.OpenSetDisp
5、layType...SynchronizeINTRODUCTIONFigure1Ihavebeenaskedthequestion,“WhyspendtheThisstructure,consistingofcontainerswithinefforttobuildanobject-orientedpmenu?Itcontainers,isanexampleofagenericdesign-seemstobesuchatrivialthing.”ForsomepatternknownasWhole-Part(Buschmann,et.minorpmenus(‘OK’,‘
6、Cancel’,‘Help’),thisisal.,pp.225-242).ThemainthrustofWhole-true;however,evensimplepmenuscancontainPartisthatanaggregationofpartscanbesurprisinglevelsofsophistication:e.g.untilatreatedtogetherasoneunit;fromtheoutside,fileisactuallyopened,‘File➠Close’shouldbeanyonelookingatthepmenustructur
7、egrayed.Thismayseemaminorpoint,butsincerepresentedinfigure1wouldseeonlythemenustendtobeoneoftheprimarymeansbyPmenucomponent.whichnewuserslearnasystem(i.e.apedagogicvector(Cooper,p.280)),aclientwillinevitablyAdditionally,thisstructurecanbefurtherselectit,crashthesystem,and