DOC PREVIEW
CU-Boulder CSCI 5448 - MORE DESIGN TECHNIQUES

This preview shows page 1-2-3-22-23-24-44-45-46 out of 46 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 46 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 46 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 46 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 46 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 46 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 46 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 46 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 46 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 46 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 46 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

© Kenneth M. Anderson, 2011MORE DESIGN TECHNIQUESCSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGNLECTURE 23 — 04/05/20111Tuesday, April 5, 2011© Kenneth M. Anderson, 2011Goals of the LectureCover the material in Chapters 15 & 16 of our textbookCommonality and Variability AnalysisThe Analysis MatrixAnd, jump ahead and cover a design patternDecorator from Chapter 17But first, another quick example of the power of delegation and the Delegate pattern (UITableView)2Tuesday, April 5, 2011© Kenneth M. Anderson, 2011Use the LessonsYo u m a y n o t a l w ay s b e a bl e t o u s e d e s i g n p a t t e r n s i n yo u r d e s i g n sYo u c a n h o w e v e r a p p l y t h e l e s s o n s l e a r n e d f r o m s t u d y i n g d e s i g n patterns in ALL of your designsFor instance, you can apply a technique known as commonality and variability analysis to identify variation in your problem domainsYo u c a n t h e n u s e d e s i g n p a t t e r n p r i n c i p l e s t o e n c a p s u l a t e t h a t variation and protect your software from potential changes3Tuesday, April 5, 2011© Kenneth M. Anderson, 2011Examine the Problem Domain (I)One key aspect of design is identifying what elements of the problem domain belong in your solution domainYo u n e e d t o i d e n t i f y t h e r i g h t t h i n g s t o m o d e l ( o r track) in your softwareYo u w a n t t o d o t h i s a s a c c u r a t e l y a s p o s s i b l e b e c a u s e the next step is to identify the relationships between those conceptsOnce you have the relationships defined, changes to the design become more difficult4Tuesday, April 5, 2011© Kenneth M. Anderson, 2011Examine the Problem Domain (II)Once you have concepts and relationships defined, inserting new concepts and relationships is less easyYo u h av e t o d e c i d e w h e r e t h e n e w c o n c e p t s “ fi t ” a n d h o w they will be integrated into the existing designExisting relationships may change or be removed and new ones will be insertedThis is why maintenance is so hard, when you are asked to change existing functionality or add new functionality, you must deal with the web of concepts and relationships that already exist in the system5Tuesday, April 5, 2011© Kenneth M. Anderson, 2011Use Commonality and Variability AnalysisCommonality and Variability Analysis attempts to identify the commonalities (generic concepts) and variations (concrete implementations) in a problem domainSuch analysis will produce the abstract base classes that can be used to interface with the concrete implementations in a generic way that will enable abstraction, type encapsulation and polymorphismOur authors demonstrate/explain the technique by example by applying it to the CAD/CAM problem6Tuesday, April 5, 2011© Kenneth M. Anderson, 2011Applying CVA to CAD/CAMThe CAD/CAM problem consists ofVersion 1 and Version 2 of the CAD/CAM SystemSlots, holes, cutouts, etc.Version 1 Models and Version 2 ModelsThese are concrete variations of generic conceptsCAD/CAM system, Feature, ModelGenerically: Commonality C has variations a, b, c7Tuesday, April 5, 2011© Kenneth M. Anderson, 2011Another techniqueTake any 2 elements of the problem domainAnd askIs one of these a variation of the other?Are both of these a variation of something else?Iterate until you start to converge on the commonalitiesEach with their associated variationswhich are just concrete elements of the domain8Tuesday, April 5, 2011© Kenneth M. Anderson, 2011Potential Problem (I)Each commonality should be based on one issueBeware collapsing two or more issues into a conceptFor the CAD/CAM domain, you might do something likeCAD/CAM FeaturesV1Slot, V2Slot, V1Cutout, V2CutoutHere you have collapsed “feature” and “version” into a single concept9Tuesday, April 5, 2011© Kenneth M. Anderson, 2011Potential Problem (II)What you need isCAD/CAM SystemV1 and V2 (versions)FeatureSlots, cutouts, holes, etc.Now you have one issue per conceptand this will lead to cohesive designs10Tuesday, April 5, 2011© Kenneth M. Anderson, 2011Tr anslating to Classes11ModelV1Model V2Model FeatureSlotHoleCutoutSpecialIrregularSystemV2SystemV1SystemTuesday, April 5, 2011© Kenneth M. Anderson, 2011Identify Relationships12If you are confident that you have identified the major concepts of the domain and their variations, you are then ready to identify the relationships that exist between themModels are aggregations of FeaturesModels are generated from a CAD/CAM SystemFeatures are generated from a CAD/CAM SystemWe’ll represent “is generated from” as a uses relationship, since it is conceivable that once these concepts are instantiated, they access the CAD system from time to timeTuesday, April 5, 2011© Kenneth M. Anderson, 2011Tr anslating to Class Diagr am13ModelV1Model V2Model FeatureSlotHoleCutoutSpecialIrregularSystemV2SystemV1SystemTuesday, April 5, 2011© Kenneth M. Anderson, 2011Reflect on the Variations14We have a duplication in the current designV1Model and V2ModelANDV1System and V2SystemWe can remove this duplication by deciding that a model produced by V1 will have features that are different than a model produced by V2 and so we can get by with just the variation in the CAD/CAM systemTuesday, April 5, 2011© Kenneth M. Anderson, 2011Updated Class Diagram15ModelFeatureSlotHoleCutoutSpecialIrregularSystemV2SystemV1SystemTuesday, April 5, 2011© Kenneth M. Anderson, 2011Connect to the Actual Systems16We must now connect this design to the actual CAD/CAM SystemsCAD/CAM Version 1 has the C APICAD/CAM Version 2 has the OO APITuesday, April 5, 2011© Kenneth M. Anderson, 2011Updated Class Diagram17ModelFeatureSlotHoleCutoutSpecialIrregularSystemV2SystemV1SystemV1ModulesOOGFeatureOOGCutoutTuesday, April 5, 2011© Kenneth M. Anderson, 2011Compare with Previous Design18FeatureSlot SpecialModelHole•••FeatureImplV1ImplV2ImplV1FacadeV1 C APIOOGFeature•••Tuesday, April 5, 2011© Kenneth M. Anderson, 2011Comparison with Design Pattern Approach (I)19CVA produced a design that is similar to the design we created in Lecture 21 using an approach that was driven by design patternsIdentify patterns that provide context for other patternsThe two approaches are synergistic and can be used in tandemDesign Patterns establish relationships between entities in the problem domainCVA identifies entities in the problem domain and


View Full Document

CU-Boulder CSCI 5448 - MORE DESIGN TECHNIQUES

Documents in this Course
Django

Django

42 pages

ENRS

ENRS

30 pages

PhoneGap

PhoneGap

22 pages

Load more
Download MORE DESIGN TECHNIQUES
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view MORE DESIGN TECHNIQUES and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view MORE DESIGN TECHNIQUES 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?