More Interfaces, Dynamic Binding, and Polymorphism Kirk Scott.

Slides:



Advertisements
Similar presentations
CS 350 – Software Design The Bridge Pattern – Chapter 10 Most powerful pattern so far. Gang of Four Definition: Decouple an abstraction from its implementation.
Advertisements

Creational Patterns, Abstract Factory, Builder Billy Bennett June 11, 2009.
Unit 7 Generic Interfaces and Encapsulation, a Class in the Middle Kirk Scott.
© 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.
Computer Science 313 – Advanced Programming Topics.
DESIGN PATTERNS OZGUR RAHMI DONMEZ.
Nov R McFadyen1 Design Patterns (GoF) contains the creational patterns: Abstract factory Builder Factory method (section 23.3 has a Simple.
 Consists of Creational patterns  Each generator pattern has a Client, Product, and Generator.  The Generator needs at least one operation that creates.
Bridge The decoupling of abstraction and implementation.
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Creational Patterns Making Objects The Smart Way Brent Ramerth Abstract Factory, Builder.
1 Using Classes Object-Oriented Programming Using C++ Second Edition 5.
Using Classes Object-Oriented Programming Using C++ Second Edition 5.
CS 4240: Bridge and Abstract Factory Readings:  Chap. 10 and 11 Readings:  Chap. 10 and 11.
Design Patterns in Java Chapter 13 Flyweight Summary prepared by Kirk Scott 1.
Unit 2 Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet,
CS 210 Introduction to Design Patterns September 28 th, 2006.
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.
Unit 4 Prototype Summary prepared by Kirk Scott 1.
Tech Talk Go4 Factory Patterns Presented By: Matt Wilson.
Unit 23 Bridge Summary prepared by Kirk Scott 1. Truss Bridge 2.
Design Patterns in Java Chapter 1 Introduction Summary prepared by Kirk Scott 1.
Unit 7 Generic Interfaces and Encapsulation, a Class in the Middle Kirk Scott.
Unit 15 Java Interfaces: Using an Interface to Accomplish a Specific Goal Kirk Scott.
Chapter 2 Introducing Interfaces Summary prepared by Kirk Scott.
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
CSE 432: Design Patterns Introduction What’s a Pattern? What’s an Idiom? According to Alexander, a pattern: –Describes a recurring problem –Describes the.
Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see.
Excellence is a Habit Feb Lecture 14 We are what we repeatedly do. Excellence, then, is not an act, but a habit.” - Aristotle.
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Unit 21 Factory Method Summary prepared by Kirk Scott 1.
Composite and Related Patterns Kirk Scott. The pitohui, a poisonous bird of New Guinea.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Chapter 17 Abstract Factory Summary prepared by Kirk Scott 1.
Billy Bennett June 22,  Intent Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.
Advanced Object-oriented Design Patterns Creational Design Patterns.
Example to motivate discussion We have two lists (of menu items) one implemented using ArrayList and another using Arrays. How does one work with these.
CS 210 Proxy Pattern Nov 16 th, RMI – A quick review A simple, easy to understand tutorial is located here:
Reference – Object Oriented Software Development Using Java - Jia COP 3331 Object Oriented Analysis and Design Chapter 10 – Patterns Jean Muhammad.
Chapter Ten The Bridge Pattern Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh.
Design Patterns. Outline Purpose Purpose Useful Definitions Useful Definitions Pattern Overview Pattern Overview.
Overview of Creational Patterns ©SoftMoore ConsultingSlide 1.
An object's behavior depends on its current state. Operations have large, multipart conditional statements that depend on the object's state.
Learning Plan 6 Java Programming Intro to Object Oriented Programming.
Factory Method Pattern. Admin SCPI Patner Day Feb. 21 Lunch count Presentation (4-8 min.) Practice on Feb. 16. Morning availablity on Feb21 Brief overview.
TK1924 Program Design & Problem Solving Session 2011/2012
Generic Interfaces and Encapsulation, a Class in the Middle
Summary prepared by Kirk Scott
Design Patterns: MORE Examples
Summary prepared by Kirk Scott
Summary prepared by Kirk Scott
Factory Patterns 1.
Unit 11 Generic Interfaces and Encapsulation, Continued
More Interfaces, Dynamic Binding, and Polymorphism
Summary prepared by Kirk Scott
object oriented Principles of software design
Chapter 17 Abstract Factory
Java Interfaces: Using an Interface to Accomplish a Specific Goal
Java Interfaces: Using an Interface to Accomplish a Specific Goal
Object Oriented Analysis and Design
Multiuser Protection and the Mediator Pattern
Object Oriented Design Patterns - Creational Patterns
Object Oriented Programming
PH Chapter 3 Thanks for the Memory Leaks Pushme-Pullyu (pp
Ms Munawar Khatoon IV Year I Sem Computer Science Engineering
BRIDGE PATTERN.
Design Patterns Part 2: Factory, Builder, & Memento
CS 350 – Software Design Singleton – Chapter 21
Presentation transcript:

More Interfaces, Dynamic Binding, and Polymorphism Kirk Scott

This is an introductory unit. These are the units/chapters belonging to this section of the course: Unit 20, Factory Method, book chapter 16 Unit 21, Abstract Factory, book chapter 17 Unit 22, Command, book chapter 24 Unit 23, Bridge, book chapter 6

What will be given next is an extremely brief overview of these topics. Although the patterns are different from each other, they continue the theme that runs throughout design patterns They illustrate the use of interfaces, polymorphism, and dynamic binding to accomplish various programming goals

Factory Method Book definition: The intent of the Factory Method is to let a class developer define the interface for creating an object while retaining control of which class to instantiate. Comment mode on: We’ve seen the use of an interface already several times This takes it into the realm of construction

Abstract Factory Book definition: The intent of the Abstract Factory, or Kit, is to allow creation of families of related or dependent objects. Comment mode on: It is not an accident that this is treated along with Factory Method It is an extension of that idea

Command Book definition: The intent of the Command pattern is to encapsulate a request in an object. Comment mode on: This pattern is not necessarily closely related to the factory patterns However, the “other example” for the command pattern follows directly from the “other example” for the factory patterns

Informally, this pattern allows you to “pass a method” You do this by creating a class containing the desired method, constructing an instance of the class, and passing that object as a parameter In the receiving code it is then possible to call the desired method on the object

Bridge Book definition: The intent of the Bridge pattern is to decouple an abstraction from the implementation of its abstract operations, so that the abstraction and its implementation can vary independently.

Comment mode on: I don’t find this statement very helpful The bridge is a very interesting and useful pattern In preview summary, to my mind it is a special kind of adapter It probably won’t be clear until an example is shown

In Summary and Mnemonic Devices: Factory Method: Constructing and returning various kinds of objects, typed to a common interface (mushroom management: keep the client code in the dark) Abstract Factory: Constructing and returning families of objects (family values) Command: Wrapping a method so that it can be passed around (in brief, “passing a method”) Bridge: A lovely kind of adapter (bridges are beautiful…)

The End