Presented by FACADE PATTERN

Slides:



Advertisements
Similar presentations
JDBC Session 4 Tonight: Design Patterns 1.Introduction To Design Patterns 2.The Factory Pattern 3.The Facade Pattern Thursday & Next Tuesday: Data Access.
Advertisements

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.
Chapter 8 Object Design Reuse and Patterns. Finding Objects The hardest problems in object-oriented system development are: –Identifying objects –Decomposing.
ECE 355 Design Patterns Tutorial Part 2 (based on slides by Ali Razavi) Presented by Igor Ivković
Façade Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Chapter 22 Object-Oriented Design
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Seven Habits of Effective Pattern Writers Facade Pattern PH pp GoF pp John Klacsmann.
Client/Server Software Architectures Yonglei Tao.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. The Façade Design Pattern (1) –A structural design pattern.
Design Patterns.
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
The Adapter Pattern SE-2811 Dr. Mark L. Hornick 1.
Facade Introduction. Intent Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
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.
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.
More Design Patterns From: Shalloway & Trott, Design Patterns Explained, 2 nd ed.
CS212: Object Oriented Analysis and Design Lecture 38: Design Pattern-II.
JAVA DESIGN PATTERN Structural Patterns - Facade Pattern Presented by: Amit kumar narela Ise Ise
The Facade Pattern (Structural) ©SoftMoore ConsultingSlide 1.
Watching the movie the hard way…. Page 256 – Head First Design Patterns.
Design Patterns: Structural Design Patterns General and reusable solutions to common problems in software design Software University
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 Facade Pattern – Chapter 6 Many design patterns are catalogued in the “Gang of Four” text. I find their definitions not to.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Examples (D. Schmidt et al)
Facade Pattern Jim Fawcett CSE776 – Design Patterns Summer 2010
Design Patterns: MORE Examples
Abstract Factory Pattern
Factory Method Pattern
Strategy Design Pattern
Façade Pattern:.
Chapter 10 Design Patterns.
Software Design Patterns
MPCS – Advanced java Programming
Design Patterns Lecture part 2.
Software Design & Documentation
Chapter Six The Facade Pattern
By SmartBoard team Adapter pattern.
Introduction to Design Patterns
Design Pattern: Facade
Factory Method Pattern
Facade Pattern Jim Fawcett CSE776 – Design Patterns Summer 2010
object oriented Principles of software design
Abstract Factory Pattern
Decorator Design Pattern
CS 350 – Software Design The Facade Pattern – Chapter 6
Intent (Thanks to Jim Fawcett for the slides)
Presented by Igor Ivković
Chapter 8, Object Design Introduction to Design Patterns
Design Patterns Satya Puvvada Satya Puvvada.
Advanced Programming Behnam Hatami Fall 2017.
Jim Fawcett CSE776 – Design Patterns Summer 2003
Mediator Design Pattern (Behavioral)
Object Oriented Design Patterns - Structural Patterns
Ms Munawar Khatoon IV Year I Sem Computer Science Engineering
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Structural Patterns: Adapter and Bridge
10. Façade Pattern SE2811 Software Component Design
Chapter 8, Design Patterns Introduction
Presented by Igor Ivković
From Use Cases to Implementation
Presentation transcript:

Presented by FACADE PATTERN “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” – Martin Fowler Presented by Dr Jim Fawcett Sneha Sinha

INTENT Question: Why Facade ? Answer: “Simplify and Encapsulate” Prime focus of today’s programming is to hide the complex implementation details of the object providing a simple client’s interface. We all get perplexed when we are asked what is the best way to do that? – No BEST There are better ways to do it.

Intent cont Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes subsystems easier to use. This can be used to simplify a number of complicated object interactions into a single interface

Motivation & Structure To simplify access to the subsystem you can route everything through a facade

Motivation cont Structuring a system into subsystems helps reduces complexity. The interface exposed by the classes in a subsystem or set of subsystems can become quite complex. To reduce this complexity, Introduce a façade object that provides a simplified and single interface to access facilities of a system.

Applicability Facade Pattern provides a simple default view of the complex system which looks very clean and easy to clients. Facade allows expert users to directly interact with its complex subsystems.

Applicabilty contd. Subsystem dependencies can be minimized by making them communicate solely with facades which promotes decoupling between subsystem and client promoting portability. To layer your subsystems. Using a Facade as an entry point to each level of sub system or subsystem of subsystem.

Applicability cont

PARTICIPANTS Facade class Which requests the appropriate class to deliver service. In real world complex system, more than one facade. Subsystem Class implements functionality of the system.

Implementation Reducing client –subsystem coupling. Public versus private subsystem classes. Clients could access public interface of the subsystem through façade and we can expose the private interface for subsystem extenders.

Collaborations Clients requests to façade to communicate with subsystem. Façade has its own implementation of forwarding the client’s request to the appropriate subsystem which is minimal. Client which uses façade don’t have to access its subsystem directly. Facade objects are often Singletons because only one Facade object is required.

Pros Shields client from subsystem component, makes subsystem easier for client to use. Promotes weak coupling between client and subsystem. This allows you to change the classes that comprise the subsystem without affecting the clients. Reduces compilation dependencies in the large software systems. Simplifies platform portability as more often only few more subsystem has to be build to achieve that.

Pros contd Lets ambitious clients to access underlying classes. It doesn’t add any functionality but simplifies interface. Increases learning curve of the team. ex: Interaction MS excel by using com object model provided by MS excel where only one team member knows the MS excel APIs.

Cons Façade pattern does not limit its client to access its subsystem interface directly. Implementation cost is worth the abstraction?

Why FAÇADE over ADAPTER Facade defines a new interface, whereas Adapter uses an old interface making two existing interfaces work together as opposed to defining an entirely new one. Well this is not the difference, it’s the definition. ;)

contd Adapter and Facade are both wrappers; but they are different kinds of wrappers. Facade routinely wraps multiple objects and Adapter wraps a single object. So the way to tell the difference between the Adapter pattern and the Facade pattern is that the Adapter wraps one class and the Facade may represent many classes?

No! While most textbook examples show the adapter adapting one class, you may need to adapt many classes to provide the interface a client is coded to. Likewise, a Facade may provide a simplified interface to a single class with a very complex interface. The difference between the two is not in terms of how many classes they "wrap", it is in their intent.

Why Abstract Factory over Facade Abstract Factory can be used as an alternative to Facade to hide platform-specific classes.

Reference Design Patterns, Elements of Reusable Object-Oriented Software, Erich Gamma, et. al., Addison-Wesley, 1994, ISBN 0-201-63361-2 Stackoverflow.com

Simple example of FAÇADE (for someone who has trouble understanding without diagram)