Seven Habits of Effective Pattern Writers Facade Pattern PH pp. 145-152 GoF pp. 185-193 John Klacsmann.

Slides:



Advertisements
Similar presentations
Software Engineering Key design concepts Design heuristics Design practices.
Advertisements

JDBC Session 4 Tonight: Design Patterns 1.Introduction To Design Patterns 2.The Factory Pattern 3.The Facade Pattern Thursday & Next Tuesday: Data Access.
AVAYA, Inc.1 Pattern Shepherding Neil B. Harrison Avaya Inc. With a few updates by Joe Bergin
BehavioralCmpE196G1 Behavioral Patterns Chain of Responsibility (requests through a chain of candidates) Command (encapsulates a request) Interpreter (grammar.
Façade Pattern Jeff Schott CS590L Spring What is a façade? 1) The principal face or front of a building 2) A false, superficial, or artificial appearance.
Week 8 Implementation Design Alex Baker. Implementation Design System Design – Describes what the system should do Implementation Design – Describes what.
Winter 2011ACS Ron McFadyen1 Façade A façade simplifies access to a related set of objects by providing one object that all objects outside the.
Façade Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Chapter 22 Object-Oriented Design
Design Patterns Ric Holt & Sarah Nadi U Waterloo, March 2010.
Analytical Thinking.
Creational Patterns Making Objects The Smart Way Brent Ramerth Abstract Factory, Builder.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. The Façade Design Pattern (1) –A structural design pattern.
P ATTERN H ATCHING : C H. 5 G O F: F AÇADE P ATTERN Josh Mason 6/29/2009.
A Behavior Object Pattern
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Personal Writing: The Memoir and the Personal Essay
Case Studies on Design Patterns Design Refinements Examples.
CS 325: Software Engineering March 17, 2015 Applying Patterns (Part A) The Façade Pattern The Adapter Pattern Interfaces & Implementations The Strategy.
SOFTWARE DESIGN AND ARCHITECTURE
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Design Patterns Part two. Structural Patterns Concerned with how classes and objects are composed to form larger structures Concerned with how classes.
The Adapter Pattern SE-2811 Dr. Mark L. Hornick 1.
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
GRASP: Designing Objects with Responsibilities
GoF Sections Design Problems and Design Patterns.
Facade Introduction. Intent Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the.
The Façade Pattern SE-2811 Dr. Mark L. Hornick 1.
Structural Design Patterns
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns IV Structural Patterns.
08 - StructuralCSC4071 Structural Patterns concerned with how classes and objects are composed to form larger structures –Adapter interface converter Bridge.
Structural Patterns1 Nour El Kadri SEG 3202 Software Design and Architecture Notes based on U of T Design Patterns class.
Behavioural Design Patterns Quote du jour: ECE450S – Software Engineering II I have not failed. I've just found 10,000 ways that won't work. - Thomas Edison.
FacadeDesign Pattern Provide a unified interface to a set of interfaces in a subsystem. Defines a high level interface that makes the subsystem easier.
Design Patterns By Mareck Kortylevitch and Piotreck Ratchinsky.
Design Pattern. Definition: A design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
More Design Patterns From: Shalloway & Trott, Design Patterns Explained, 2 nd ed.
JAVA DESIGN PATTERN Structural Patterns - Facade Pattern Presented by: Amit kumar narela Ise Ise
The Mediator Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
Adapter and Façade Patterns By Wode Ni and Leonard Bacon-Shone.
CSC 480 Software Engineering Design With Patterns.
The Facade Pattern (Structural) ©SoftMoore ConsultingSlide 1.
Watching the movie the hard way…. Page 256 – Head First Design Patterns.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Broker Design Patterns: Façade and Mediator.
By: Jeff Kang and Nicole Alvarez. Analytical focus.
Seung Ha.  Façade is generally one side of the exterior of a building, especially the front.  Meaning “frontage” or “face”  In software architecture,
CS 350 – Software Design The Adapter Pattern – Chapter 7 Gang of Four Definition: Convert the interface of a class into another interface that the client.
CS 350 – Software Design The Facade Pattern – Chapter 6 Many design patterns are catalogued in the “Gang of Four” text. I find their definitions not to.
Abstract Factory Pattern Jiaxin Wang CSPP Winter 2010.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
What makes a leader? A leader is a person who directs or who is in charge of others. Leadership is a blend of talents, qualities and skills that a leader.
Elaboration: Iteration 2. Elaboration: Iteration 2 Basics Iteration 1 ends with : All the software has been tested: The idea in the UP is to do early,
Facade Pattern Jim Fawcett CSE776 – Design Patterns Summer 2010
Presented by FACADE PATTERN
Façade Pattern:.
MPCS – Advanced java Programming
Design Patterns Lecture part 2.
Software Design & Documentation
Design Pattern: Facade
Skills for change Hot off the press! How to get media coverage.
Facade Pattern Jim Fawcett CSE776 – Design Patterns Summer 2010
Decorator Design Pattern
CS 350 – Software Design The Facade Pattern – Chapter 6
The Object-Oriented Thought Process Chapter 05
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Software Design Lecture : 35.
CSC 480 Software Engineering
defines a higher-level interface that makes a subsystem easier to use
Presentation transcript:

Seven Habits of Effective Pattern Writers Facade Pattern PH pp GoF pp John Klacsmann

Other Famous Gang of Four’s Chinese Communist Politicians (1976) British Post-Punk Band ( )

Seven Habits of Effective Pattern Writers 1. Take Time to Reflect 2. Adhere to a Structure 3. Be Concrete Early and Often 4. Keep Patterns Distinct and Complementary 5. Present Effectively 6. Iterate Tirelessly 7. Collect and Incorporate Feedback

1. Take Time To Reflect Think about past problems and solutions Record Your Experiences Describe the problem Describe the problem Why is it difficult? Why is it difficult? Write down new approaches Write down new approaches Why did it fail? Why did it succeed? Why did it fail? Why did it succeed? Forms raw material of patterns Forms raw material of patterns

1. Take Time To Reflect Identify Patterns You Already Know If find something new & unique make sure you have at least two existing examples of a problem & solution

2. Adhere to a Structure Pattern: “A Structured Exposition of a solution to a problem in context” Include: Name Name Statement of Problem Statement of Problem Context and Justification of Solution Context and Justification of Solution Solution itself Solution itself Settle on structure & keep it consistent

3. Be Concrete Early and Often People understand better when presented in concrete first then abstract Use examples and counterexamples “Tell the whole truth” Warn reader of potential pitfalls Warn reader of potential pitfalls Extra Cost Extra Cost Ill-behavior under certain circumstances Ill-behavior under certain circumstances Other patterns Other patterns Etc. Etc.

4. Keep patterns distinct and complementary Insure patterns are distinct Might not be obvious Ask: “How is pattern X different from pattern Y?” Let intents of patterns be guide to differences, not class structures Spend time comparing and contrasting your patterns

5. Present Effectively Typesetting and Writing Style are important Use drawings liberally to illustrate key points Make pattern approachable Use down-to-earth writing style Use down-to-earth writing style Write conversationally Write conversationally

6. Iterate Tirelessly Pattern writing is an ongoing process Expect to write and rewrite your pattern many times Don’t perfect before moving on

7. Collect and Incorporate Feedback “No pattern can be trusted until it is used by someone other than its author” Make pattern understandable to people who have never had the problem Discuss with colleagues Look for opportunities to use Get comments & be prepared to hear the worst Give reviewers benefit of doubt Give reviewers benefit of doubt Bend over backwards to make them happy Bend over backwards to make them happy

Seven Habits of Effective Pattern Writers Follow these steps to make your own patterns better The better your patterns are, the more impact they’ll have

GoF’s Facade Pattern Make it simpler Defines a higher-level interface that makes the subsystem easier to use From:

Motivation Structuring into subsystems helps reduce complexity Provides a single, simplified interface to the more general (complex) facilities of a subsytem

Compiler Example Contains subsystem of classes Most clients don’t care about details – just want to compile Low-level only complicates task

Compiler Example Compiler class acts as Façade Provides higher level interface that shields clients from lower-level classes Makes life easier for programmer without hiding the low- level functionality completely Puts all pieces of compile operation together

When to use Facade When you want a simple interface to a complex subsystem Provides simple default view good enough for most clients Provides simple default view good enough for most clients

When To Use Facade When there are many dependencies between clients and implementation classes Decouples subsystem from clients Decouples subsystem from clients When you want to layer your subsystems Simplify dependencies between subsystems by making them communicate only through their facades Simplify dependencies between subsystems by making them communicate only through their facades

Structure Façade Delegates client requests to appropriate subsystem objects Delegates client requests to appropriate subsystem objects Subsystem Classes Implement subsystem Implement subsystem Handle work assigned by Façade Handle work assigned by Façade Have no knowledge of façade (keep no references) Have no knowledge of façade (keep no references)

Benefits Shields client from subsystem Reduces number of objects the client deals with Reduces number of objects the client deals with Makes subsystem easier to use Makes subsystem easier to use Promotes weak coupling between subsystem and its clients Helps eliminate complex or circular dependencies Helps eliminate complex or circular dependencies Minimizes recompilation time needed for small subsystem change Minimizes recompilation time needed for small subsystem change Applications can still use subsystem classes if needed Provides both ease of use & generality Provides both ease of use & generality

How is this different then Mediator? Mediator abstracts communication between objects, centralizing functionality Mediator’s colleagues are aware of it and communicate with it instead of with each other Façade abstracts the interface to a subsystem to make it easier It doesn’t provide any new functionality and subsystem classes don’t know about it

Questions?