Facade From www.m-w.com Main Entry: fa·cade Variant(s): also fa·çade /f&-'säd/ Function: noun Etymology: French façade, from Italian facciata,

Slides:



Advertisements
Similar presentations
Oct 2, Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m Function:
Advertisements

March R McFadyen1 Architecture Architecture involves the set of significant decisions about the organization of a software system, decisions.
Oct R McFadyen1 Recall UML Class Diagram BusRoute BusStopList BusStop BusList BusPersonList Person passengers buses busStops waiting 0..*
Feb R. McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m Function:
Nov R McFadyen1 Design Patterns (GoF) contains the creational patterns: Abstract factory Builder Factory method (section 23.3 has a Simple.
Fall 2009ACS-3913 R McFadyen1 Design Patterns (GoF) contains the creational patterns: Abstract factory Builder Factory method (Simple Factory) Prototype.
March R McFadyen1 Design Patterns (GoF) contains the creational patterns: Abstract factory Builder Factory method (in Larman) Prototype Singleton.
Design Pattern Course Builder Pattern 1 Mahdieh Monzavi AmirKabir University of Technology, Department of Computer Engineering & Information Technology.
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.
NJIT More GRASP Patterns Chapter 22 Applying UML and Patterns Craig Larman Prepared By: Krishnendu Banerjee.
Case Study The NextGen POS System
Nov Ron McFadyen1 Observer P Problem: There are many objects (subscribers) needing to know of the state changes, or events, of another.
Fall 2009ACS-3913 R McFadyen1 GoF Patterns, chapter 26 GoF book presents 23 patterns: Creational – 5 Structural – 7 Behavioural – 11 Larman discusses 7.
March R McFadyen1 Façade. March R McFadyen2 Facade P Main Entry: fa·cade Variant(s): also fa·çade / f&-'säd/ Function: noun.
February Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m.
March R McFadyen1 GoF (Gang of Four): Gamma, Johnson, Helm & Vlissides Book: Design Patterns: Elements of Reusable Object-Oriented Software.
Fall 2009ACS-3913 R McFadyen1 Singleton Problem: Exactly one instance of a certain object is required (this object is called a singleton). We must ensure.
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.
Fall 2009ACS-3913 R. McFadyen1 Protected Variations Principle: How do you design so that variations in the future do not have an undesirable affect on.
GRASP : Designing Objects with Responsibilities
Façade Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Chapter 22 Object-Oriented Design
Sept Ron McFadyen1 Extend Relationship.
Fall 2009ACS-3913 Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Date: 1753 an interpretation.
March R McFadyen1 Figure 30.2 Layers in NextGen They only have three layers in this architecture Each layer is shown as a UML Package No separate.
Chapter 26 Applying Gang of Four Design Patterns 1CS6359 Fall 2012 John Cole.
Design Patterns Ric Holt & Sarah Nadi U Waterloo, March 2010.
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 Alan Shalloway, James Trott, Design Patterns Explained, Addison-Wesley, Gamma, Helm, Johnson, Vlissides, Design Patterns, Elements.
Systems Analysis and Design in a Changing World, Fifth Edition
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
MIS 2502 Business Rules BJ’s is interested in developing a new application. The database will track product, customer, and sale information. It will.
GRASP Principles. How to Design Objects The hard step: moving from analysis to design How to do it? –Design principles (Larman: “patterns”) – an attempt.
12 Systems Analysis and Design in a Changing World, Fifth Edition.
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
Chapter 26 GoF Design Patterns. The Adapter Design Pattern.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
GoF Design Patterns (Ch. 26). GoF Design Patterns Adapter Factory Singleton Strategy Composite Façade Observer (Publish-Subscribe)
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
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.
Oct R McFadyen1 Facade P Problem: There are a set of classes, a subsystem, that you need to interact with for some purpose, but you don’t.
What to remember from Chap 13 (Logical architecture)
Structural Design Patterns
OO Methodology Elaboration Iteration 2 - Design Patterns -
Fall 2009ACS-3913 Ron McFadyen1 Use Case Realizations with GRASP Patterns “The assignment of responsibilities and design of collaborations are very important.
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.
Watching the movie the hard way…. Page 256 – Head First Design Patterns.
Expense Tracking System Developed by: Ardhita Maharindra Muskan Regmi Nir Gurung Sudeep Karki Tikaprem Gurung Date: December 05 th, 2008.
Sept Ron McFadyen1 Include Relationship UC1:Process Sale … Main Success Scenario … 7. Customer pays and System handles payment. … Extensions.
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,
Elaboration popo.
Presented by FACADE PATTERN
Presentation on GoF Design Patterns Submitted by WWW. ASSIGNMENTPOINT
GoF Patterns (GoF) popo.
MPCS – Advanced java Programming
Chapter Six The Facade Pattern
Design Pattern: Facade
DESIGN MODEL: USE-CASE REALIZATIONS WITH GRASP PATTERNS
Design Patterns (GoF) contains the creational patterns:
GoF Design Patterns (Ch. 26). GoF Design Patterns Adapter Factory Singleton Strategy Composite Façade Observer (Publish-Subscribe)
GoF Design Patterns (Ch. 26)
Figure 30.2 Layers in NextGen
The Islamia University Bahawalpur
GoF Design Patterns (Ch. 26)
defines a higher-level interface that makes a subsystem easier to use
GoF Patterns Ch. 26.
Presentation transcript:

Facade From www.m-w.com Main Entry: fa·cade Variant(s): also fa·çade /f&-'säd/ Function: noun Etymology: French façade, from Italian facciata, from faccia face, from (assumed) Vulgar Latin facia Date: circa 1681 1 : the front of a building; also : any face of a building given special architectural treatment <a museum's east facade> 2 : a false, superficial, or artificial appearance or effect Fall 2009 ACS-3913 R McFadyen

Facade Problem: There are a set of classes, a subsystem, that you need to interact with for some purpose, but you don’t want to create dependencies on this subsystem. Solution: Create a class that wraps this subsystem. The wrapper will define an interface that hides the details (classes, methods) of the subsystem. The façade is a “front-end” object that defines a single point of entry to the subsystem’s services. A façade, a wrapper Showing the classes as a package (a subsytem) Fall 2009 ACS-3913 R McFadyen

NextGen POS is a system to be sold to many customers. Facade Text example. NextGen POS is a system to be sold to many customers. Customers will want to customize NextGen POS Example: Payment rules may vary for gift certificates. How are gift certificates to be handled: One per customer per purchase? No change is returned - another gift certificate issued? To allow flexibility, it is desired to reduce the impact of changes to the rest of the system To reduce the impact, the Façade pattern is applied and the subsytem will be hidden behind a single object Fall 2009 ACS-3913 R McFadyen

Figure Sale objects, in the Domain package, access the POS Rule Engine via the façade in the POSRuleEngine package if ( POSRuleEngineFacade.getInstance().isInvalid(…) ... Public class Sale … Fall 2009 ACS-3913 R McFadyen

Façades are normally accessed via the Singleton pattern. if ( POSRuleEngineFacade.getInstance().isInvalid(…) ... Public class Sale … Singleton is a pattern whereby one instance of an object of some class is created/allowed. The class will have a static method that returns the singleton. Façades are normally accessed via the Singleton pattern. Fall 2009 ACS-3913 R McFadyen

:POSRuleEngineFacade :Sale :POSRuleEngineFacade :SalesLineItem makeLineItem() isInvalid (…) . [valid] add (…) Fall 2009 ACS-3913 R McFadyen

Example: (from Design Patterns Explained by Shalloway & Trott) Suppose a client object must deal with Databases, Models, and Elements. The client must first open the Database, then get a Model, then queries the Model for Elements, and finally gets Elements. I.e. Database Client Model Element Fall 2009 ACS-3913 R McFadyen

Example: (from Design Patterns Explained by Shalloway & Trott) It may be easier to create a Database Façade that can be used by clients I.e. ClientA Database Db Facade ClientB Model Element ClientC To use the database, one only needs to become aware of DbFacade, and learn how to use it. Fall 2009 ACS-3913 R McFadyen

Example: (from Design Patterns Explained by Shalloway & Trott) It may be easier to create a Database Façade that can be used by clients I.e. ClientA Database Db Facade ClientB Model Element ClientC To use the database, one only needs to become aware of DbFacade, and learn how to use it. Fall 2009 ACS-3913 R McFadyen

(from Design Patterns Explained by Shalloway & Trott) When to use Facade (from Design Patterns Explained by Shalloway & Trott) To create a simpler interface: number of methods, number of objects one has to deal with The system being hidden may have an older, more complex interface The cost of developing the façade, and of developers learning the new interface may be less than learning the old one You may only be needing a subset of the functionality You may want to augment the functionality of the system To facilitate tracking system usage – by forcing all requests to go through a Façade class, one can easily track the usage. To facilitate subsystem replacement – only one class is affected, the Façade class. This is the motivation in Larman’s example. Fall 2009 ACS-3913 R McFadyen