DOC PREVIEW
MSU CSE 870 - Design Patterns

This preview shows page 1-2-3-24-25-26-27-48-49-50 out of 50 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 50 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 50 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 50 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 50 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 50 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 50 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 50 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 50 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 50 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 50 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 50 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Design Patterns a Presentation by Sascha KonradOverviewIntroduction (1)Introduction (2)What Is a Design Pattern (1)What Is a Design Pattern (2)Pattern NameProblemSolutionConsequencesDesign Patterns Are NotWhere Design Patterns Are UsedHow to Describe Design PatternsA Description TemplateClassificationHow Design Patterns Solve Design ProblemsFinding Appropriate ObjectsDetermining Object GranularitySpecifying Object InterfacesSpecifying Object Implementations (1)Specifying Object Implementations (2)Putting Reuse Mechanism to Work (1)Putting Reuse Mechanism to Work (2)Relating Run-Time and Compile-Time StructuresDesigning for ChangeDesign Patterns in Application ProgramsDesign Patterns in ToolkitsDesign Patterns in FrameworksHow to Select a Design PatternHow to Use a Design PatternHow Not to Use a Design PatternConclusionWhat to Expect from Design PatternsA Common Design VocabularyA Documentation and Learning AidAn Adjunct to Existing MethodsA Target for Refactoring (1)A Target for Refactoring (2)A Parting ThoughtTwo ExamplesSingleton (1)Singleton (2)Singleton (3)Singleton (4)Singleton (5)Singleton (6)Observer (1)Observer (2)Observer (3)Observer (4)1Design Patternsa PresentationbySascha Konrad2OverviewIntroductionWhat Is a Design PatternHow to Describe Design PatternsHow Design Patterns Solve Design ProblemsDesigning for ChangeHow to Select a Design PatternConclusionTwo Examples351316252932403Introduction (1)Design Patterns Sascha Konrad• Designing object-oriented software is hard, designing reusable object-oriented software is even harder• Design should be specific to problem, but also general enough to address future problems and requirements• Expert designers reuse solutions that have worked for them in the past  Recurring patterns of classes and communicating objects exist in many object-oriented systems4Design Patterns Sascha Konrad• If details of previous problems and their solutions are known, then they could be reused  Recording experience in software design for others to use Design patterns= important and recurring design in object- oriented systemsIntroduction (2)5Design Patterns Sascha Konrad“Each pattern describes a problem which occurs over and over again in our environment and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it in the same way twice”Christopher Alexander, A Pattern Language, 1977What Is a Design Pattern (1)6Design Patterns Sascha KonradA pattern has in general 4 essential elements:• Pattern name• Problem• Solution• ConsequencesWhat Is a Design Pattern (2)7Design Patterns Sascha Konrad• A handle used to describe a design problem, its solutions and its consequences in a word or two• Increases design vocabulary• Makes it possible to design at a higher level of abstraction• Enhances communication• But finding a good name is often hardPattern Name8Design Patterns Sascha Konrad• Describes when to apply the pattern• Explains the problem and its context• Might describe specific design problems or class or object structures• Sometimes contains a list of conditions that must be met before it makes sense to apply the patternProblem9Design Patterns Sascha Konrad• Describes the elements that make up the design, their relation- ships, responsibilities and collaborations• Doesn’t describe a particular concrete design or implemen- tation• Abstract description of design problems and how the pattern solves itSolution10Design Patterns Sascha Konrad• Results and trade-offs of applying the pattern• Critical for evaluating design alternatives and for understan- ding the costs and benefits of applying the pattern• Includes the impacts of a pattern on a system’s flexibility, ex- tensibility or portabilityConsequences11Design Patterns Sascha Konrad• Designs that can be encoded in classes and reused as is (i.e. linked lists, hash tables)• Complex domain-specific designs (for an entire application or subsystem)They are:“Descriptions of communicating objects and classes that are customized to solve a general design problem in a particularcontext.”Design Patterns Are Not12Design Patterns Sascha Konrad• Design patterns can be implemented in object-oriented pro- gramming languages rather than procedural languages.• In procedural languages design patterns for Inherit ance, Poly- morphism and Encapsulation would be definedWhere Design Patterns Are Used13Design Patterns Sascha Konrad• Graphical notation is not sufficient• To reuse design decisions, alternatives and trade-offs that led to the decisions are important• Concrete examples are also importantHow to Describe Design Patterns14Design Patterns Sascha Konrad• Pattern Name and Classification• Intent• Also Known As• Motivation• Applicability• Structure• ParticipantsA Description Template• Collaborations• Consequences• Implementation• Sample Code• Known Uses• Related Patterns15Design Patterns Sascha KonradDesign patterns can be classified by two criteria:1. PurposeWhat a pattern does (creational, structural or behavioral)2. Scope Whether the pattern applies primarily to classes (static,compile-time) or to objects (dynamic, run-time)Classification16Design Patterns Sascha KonradDesign patterns solve many of the day-to-day problems object-oriented designers face, and in many different ways. Here are several of these problems and how design patterns solve them.How Design Patterns SolveDesign Problems17Design Patterns Sascha KonradFinding Appropriate Objects• Hard part of object-oriented design is decomposing a system into objects Encapsulation, granularity, dependency, flexibility, performance, …• Design Patterns help identifying less obvious abstractions and the objects that can capture them18Design Patterns Sascha KonradDetermining Object Granularity• Objects can vary tremendously in size and number• Design patterns address this also i.e. describing how to decompose an object into smaller objects19Design Patterns Sascha KonradSpecifying Object Interfaces• An object’s interface characterizes the complete set of requests that can be sent to the object• A type = particular interface• Subtypes inherit the


View Full Document

MSU CSE 870 - Design Patterns

Documents in this Course
HW2

HW2

3 pages

splc1

splc1

21 pages

Lessons

Lessons

3 pages

revision

revision

13 pages

ft1

ft1

12 pages

john.dsn

john.dsn

21 pages

Survey

Survey

2 pages

revision

revision

38 pages

Load more
Download Design Patterns
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 Design Patterns 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 Design Patterns 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?