CSC520Fall2014MidtermExamStudyGuide, including Design patterns (last page)

1.KnowthemaindiagrammingconstructsforaUMLclassdiagram--Whatareaninterface,aclass,aninheritancelink(a.k.a.generalization,ithasahollowtriangulararrowtothebaseclass orinterface),andanassociationlink(ifithasaanarrow,it'llbenon-hollow;thearrowmakesitanavigableassociation).AssociationfromclassAtoclassBmeansthatclassA"knowsabout" or"uses"classB.

2.Inthatclassdiagramcontext,knowhow"interfaceinheritance"appears,andknowwhatitmeans.Theinheritancearrowalwayspointstoaninterfaceininterfaceinheritance.

3.Inthatclassdiagramcontext,knowhow"implementationinheritance"appears,andknow whatitmeans.Theinheritancearrowalwayspointstoaclassinimplementationinheritance.

4.KnowtheroleofaJavainterface.Inessencetheroleis"specificationofmethodsignature, methodsemantics,andoptionallysymbolicconstants."

5.Knowthemeaningandpurposeofanabstractclass.Oftenthepurposeistohousehelper methodsandfieldsforderivedclassesoftheabstractclass.Anabstractclassisonlypartially defined--itismissingoneormoremethods--whereasaconcreteclassiscomplete.Youcan constructanobjectofaconcreteclass,butnotofanabstractclass.

6.KnowthemeaningofthesetermsinO-Oprogramming:encapsulation,dataabstraction, abstractdatatypes,inheritance,polymorphism,andreuse.

7.KnowhowandwhentousegenericclassesinJavaandotherO-Olanguagesthatsupportthem.AC++templateclassisequivalenttoaJavagenerictemplateclassforpurposesofthis item.

8.Knowgenerally,whichclassesinaUMLclassdiagrammightrepresentplug-inmodules, thatimplementaninterfacerepresentingtheplug-in,andthataplug-inloadercanloadviadynamicloadingofaclassfromthefilesystem.

9.Knowtheprivate,public,protected,andimplicitpackageaccessmodifiersinJavaandwhattheymeanwhenappliedtoamethod,fieldorclass.

10.KnowDesignByContract,includingthemeaningofpreconditions,postconditionsand classinvariants.Methodpreconditionsareoncallers(clients)andpostconditionsareonthecalledmethodandunderlyingobject(providers).Whenaredefinitionofamethodoccursinasubclass,apreconditionmayoptionallybecomeweakerforthesubclassmethod,andapostconditionmayoptionallybecomestronger.Acallertoabaseclassmethodwhomeetsthestrongerpreconditionofthebaseclasstherebymeetstheweakerpreconditionofthederived class.Acalleeinaderivedclassthatsatisfiesthestrongerpostconditiontherebysatisfiestheweakerpostconditionofthebaseclassmethod.

11.Knowgenerallytheformoruseofaclassdiagram,adeploymentdiagram,astatediagram, andanobjectdiagramintheUML.KnowinoutlineformtheDesignPatternsin besummaryquestions,notdetailedquestions.

CSC 520 Fall 2014, D.Parson,DESIGNPATTERNSto Know for Midterm Exam

See MVC.See others.

1. / Model-View-Controller / (#1-2 are related to GUIsandgenerallyto presentation.)
2. / Observer
3. / FactoryMethod / (#3-5and #14 related toobjectconstruction.)
4. / AbstractFactoryClass
5. / Singleton
6. / Iterator / (#6-10 areBehavioralPatterns.)
7. / Visitor

8. ChainofResponsibility (a.k.a.delegation)

12.Command

13.Interpreter

11.Adapter (I call this a software shim.) (#11-13 areStructuralPatterns.)

12.Composite (whole-partshierarchy,“composed of”)

13.Proxy(Iadded Proxyfor network proxies. Wewill discuss.)

14.Builder(Iadded this because theHexAtom Jython mainsectionsareBuilders.)

Usingstring-basedCommandObjects in conjunction withInterpreter Objectsfor theirinterpretationprovides readysupport for thefollowingcapabilities.

A.Scripting– You canintegrateapplication-orientedcommands into scriptinglanguageinterpreters such asPython. HexAtom does that.)

B.Networking– String-basedcommands areeasytopass overanetworkwithout addinganapplication-specific protocollayer orusingproprietaryor semi-proprietaryprotocolssuchas Java RMI. Just send the strings viaUDPdatagrams or TCPconnections.

C.Simple–It is easytostoreandsend / receive strings.

D.Extensible– You can build newsoftware using“primitive commands” with a scriptinglanguage asglue.

E.This approachleveragesregularexpressionlibraries and compiler libraries.