William Shiver.  Pattern used to decouple an abstraction from its implementation so that the two can vary independently.

Slides:



Advertisements
Similar presentations
Chapter 5: Hiding implementation ● Two viewpoints regarding classes: – Implementor of a class: knows everything about class – User of a class: Only wants.
Advertisements

Chain of Responsibility Pattern Gof pp Yuyang Chen.
CS 350 – Software Design The Bridge Pattern – Chapter 10 Most powerful pattern so far. Gang of Four Definition: Decouple an abstraction from its implementation.
Containers and Components 1.Containers collect GUI components 2.Sometimes, want to add a container to another container 3.Container should be a component.
CSC1351 9/6/2011 Where are we?. Polymorphism // Use dynamic lookup to allow different data types to be manipulated // with a uniform interface. public.
Vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Basic OO Technology Technology determines the effectiveness of the approach.
1 Structural Design Patterns - Neeraj Ray. 2 Structural Patterns - Overview n Adapter n Bridge n Composite n Decorator.
Linzhang Wang Dept. of Computer Sci&Tech, Nanjing University The Bridge Pattern.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Generator Design Patterns: The Factory Patterns.
The Bridge Pattern.. Intent Decouple an abstraction from its implementation so that the two can vary independently Also known as: Handle/Body.
PATTERNS -STRUCTURAL PATTERNS WATTANAPON G SUTTAPAK Software Engineering, School of Information Communication Technology, University of PHAYAO 1.
Command Pattern 1. Intent Encapsulates a request as an object, thereby letting you parameterize other objects with different requests, queue or log request,
Design Patterns A General reusable solution to a commonly occurring problem in software design. Creational: Deal with object creation mechanisms – Example:
SWE 4743 Strategy Patterns Richard Gesick. CSE Strategy Pattern the strategy pattern (also known as the policy pattern) is a software design.
The Bridge Pattern Guang Hu February Overview MotivationMotivation ParticipantsParticipants  Structure  Applicability  Benefits  Drawbacks 
Bridge The decoupling of abstraction and implementation.
Patterns Lecture 2. Singleton Ensure a class only has one instance, and provide a global point of access to it.
Prototype Pattern Creational Pattern Specify the kinds of objects to create using a prototypical instance, and create new objects by copy this prototype.
Slides prepared by Rose Williams, Binghamton University Chapter 13 Interfaces and Inner Classes.
ECE 355 Design Patterns Tutorial Part 3 Presented by Igor Ivković
Command Pattern Chihung Liao Cynthia Jiang. Waiter Order Execute() Hamburger Execute() Hot Dogs Execute() Fries Execute() Cook Make Food()
Design Pattern – Bridge (Structural) References Yih-shoung Chen, Department of Information Engineering, Feng Chia University,Taiwan, R.O.C. The Bridge.
Abstract Classes b b An abstract class is a placeholder in a class hierarchy that represents a generic concept b b An abstract class cannot be instantiated.
Chapter 22 Object-Oriented Design
Inheritance in C++ CS-1030 Dr. Mark L. Hornick.
©Fraser Hutchinson & Cliff Green C++ Certificate Program C++ Intermediate Access Control.
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.
Abstract Factory Design Pattern making abstract things.
Design Patterns Introduction to Design Patterns Eriq Muhammad Adams J. Mail : | Blog :
The Strategy Pattern SE-2811 Dr. Mark L. Hornick 1 Class 1-2.
Structural Pattern: Bridge When the abstract interface and the concrete implementation have been set up as parallel class hierarchies, it becomes difficult.
Creational Pattern: Factory Method At times, a framework is needed to standardize the behavior of objects that are used in a range of applications, while.
Design Patterns Structural Patterns. Adapter Convert the interface of a class into another interface clients expect Adapter lets classes work together.
The Builder pattern Shuanghui Luo. Type & intent One of the Creational PatternOne of the Creational Pattern Intent:Intent:  Separates the construction.
Linzhang Wang Dept. of Computer Sci&Tech, Nanjing University The Strategy Pattern.
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
Design Patterns ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University.
The Strategy Pattern SE-2811 Dr. Mark L. Hornick 1.
The Bridge Pattern (Structural) “All problems in computer science can be solved by another level of indirection.” – Butler Lampson ©SoftMoore ConsultingSlide.
The Strategy Design Pattern © Allan C. Milne v
Bridge Bridge is used when we need to decouple an abstraction from its implementation so that the two can vary independently. This type of design pattern.
Adaptor Bridge Composite UNIT-IV1 Repeated key points for Structural Patterns (Intent, Motivation, Also Known As…) Code Examples Reference
Seung Ha.  Façade is generally one side of the exterior of a building, especially the front.  Meaning “frontage” or “face”  In software architecture,
Singleton Pattern. Problem Want to ensure a single instance of a class, shared by all uses throughout a program Context Need to address initialization.
Object Oriented Programming in C++ Chapter 7 Dynamic Binding.
By Robert Smith Feb 23,  The normal method of dealing with an abstraction having several implementations is through inheritance.  However, this.
Computer Science Topical Paper Presentation #03 Adam Coffman The Cascading Bridge C a s c a d i n g B r i d g e – P a g e 1 The Cascading Bridge.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 20 - Virtual Functions Outline 20.1Introduction 20.2Type Fields and switch Statements 20.3Virtual.
Factory Patterns. DCS – SWC 2 Being less concrete One important OO principle is: ”Program to an interface, not an implementation” Interfaces reduces the.
STRATEGY PATTERN By Michelle Johnson. BACKGROUND Behavioral Pattern Allow you to define a family of algorithms, encapsulate each one, and make them interchangeable.
CS 350 – Software Design The Decorator Pattern – Chapter 17 In this chapter we expand our e-commerce case study and learn how to use the Decorator Pattern.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
Slides prepared by Rose Williams, Binghamton University ICS201 Lecture 7 : Interfaces King Fahd University of Petroleum & Minerals College of Computer.
Command Pattern. Intent encapsulate a request as an object  can parameterize clients with different requests, queue or log requests, support undoable.
Façade Pattern:.
Interface.
Object-Orientated Programming
Command Pattern 1.
Java LESSON 7 Objects, Part 1
null, true, and false are also reserved.
Generation Gap By Kurt Rehwinkel
SE-2811 Software Component Design
Design Patterns Difficult to describe abstractly Elements:
BRIDGE PATTERN.
Structural Patterns: Adapter and Bridge
Adapter Design Pattern
Design Patterns (Gamma, Helm, Johnson, Vlissides)
OOP Aga private institute for computer science 5th grade
Static Binding Static binding chooses the function in the class of the base class pointer, ignoring any versions in the class of the object actually.
Presentation transcript:

William Shiver

 Pattern used to decouple an abstraction from its implementation so that the two can vary independently

 Abstraction class- Defines the abstraction interface  Refined Abstraction Class-Expands the Abstraction Interface  Implementor -defines the interface for implementation classes  Concrete Implementor -class implements the Implementor interface and defines its concrete implementation

 Implements run-time binding  Allow multiple implementations to be shared with the same client  Implementations can be changed with out changing the client  Implementations and Abstractions can be changed separately

 Double Indirection-when a pointer can reference another pointer, requiring two dereference operations to get to the original value

Switch.java package structural.bridge; /** * Just two methods. on and off. */ public interface Switch { // Two positions of switch. public void switchOn(); public void switchOff(); }// End of interface

Fan.java package structural.bridge; /** * Implement the switch for Fan */ public class Fan implements Switch { private String state= “off”; // Two positions of switch. public void switchOn() { state=“on”; } public void switchOff() { state=“off”; } }// End of class

Bulb.java package structural.bridge; /** * Implement the switch for Bulb */ public class Bulb implements Switch { private String state= “off”; // Two positions of switch. public void switchOn() { state=“on”; } public void switchOff() { state=“off”; } }// End of class