Using Software Design Patterns Bill Anderson. About me Fox developer since 1987 Fox developer since 1987 Program Director, Los Angeles Visual Foxpro Developers.

Slides:



Advertisements
Similar presentations
Design Patterns.
Advertisements

 Recent researches show that predicative programming can be used to specify OO concepts including classes, objects, interfaces, methods, single and multiple.
Design Patterns Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
BehavioralCmpE196G1 Behavioral Patterns Chain of Responsibility (requests through a chain of candidates) Command (encapsulates a request) Interpreter (grammar.
Design Patterns. What are design patterns? A general reusable solution to a commonly occurring problem. A description or template for how to solve a problem.
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
Spring 2010CS 2251 Design Patterns. Spring 2010CS 2252 What is a Design Pattern? "a general reusable solution to a commonly occurring problem in software.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
Design Patterns Module Name - Object Oriented Modeling By Archana Munnangi S R Kumar Utkarsh Batwal ( ) ( ) ( )
Reuse Activities Selecting Design Patterns and Components
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
CERN – European Organization for Nuclear Research GS Department – Administrative Information Services Design Patterns in Groovy Nicolas Décrevel Advanced.
More OOP Design Patterns
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Idioms and Patterns polymorphism -- inheritance and delegation idioms -- realizing.
Design Patterns Introduction. What is a Design Pattern?  A technique to repeat designer success.  Borrowed from Civil and Electrical Engineering domains.
BDP Behavioral Pattern. BDP-2 Behavioral Patters Concerned with algorithms & assignment of responsibilities Patterns of Communication between Objects.
Design Patterns.
05 - Patterns Intro.CSC4071 Design Patterns Designing good and reusable OO software is hard. –Mix of specific + general –Impossible to get it right the.
Case Studies on Design Patterns Design Refinements Examples.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Design Pattern. The Observer Pattern The Observer Pattern defines a one-to-many dependency between objects so that when one object changes state, all.
Patterns in programming 1. What are patterns? “A design pattern is a general, reusable solution to a commonly occurring problem in software. A design.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Behavioral Design Patterns Morteza Yousefi University Of Science & Technology Of Mazandaran 1of 27Behavioral Design Patterns.
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns IX Interpreter, Mediator, Template Method recap.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
Chapter 8 Object Design Reuse and Patterns. Object Design Object design is the process of adding details to the requirements analysis and making implementation.
ECE450S – Software Engineering II
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
CSC 480 Software Engineering Design With Patterns.
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.
DESIGN PATTERNS -BEHAVIORAL PATTERNS WATTANAPON G SUTTAPAK Software Engineering, School of Information Communication Technology, University of PHAYAO 1.
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-1 PS95&96-MEF-L10-1 Dr. M.E. Fayad Creationa.
Manali Joshi1 The Observer Design Pattern Presented By: Manali Joshi.
CS 210 Final Review November 28, CS 210 Adapter Pattern.
Behavioral Patterns1 Nour El Kadri SEG 3202 Software Design and Architecture Notes based on U of T Design Patterns class.
Design Patterns. 1 Paradigm4 Concepts 9 Principles23 Patterns.
Design Patterns Introduction
BEHAVIORAL PATTERNS 13-Sep-2012 Presenters Sanjeeb Kumar Nanda & Shankar Gogada.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 31. Review Creational Design Patterns – Singleton Pattern – Builder Pattern.
CS251 – Software Engineering Lectures 18: Intro to DP Slides by Rick Mercer, Christian Ratliff, Oscar Nierstrasz and others 1 و ابتغ فيما آتاك الله الدار.
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:
Five Minute Design Patterns Doug Marttila Forest and the Trees May 30, 2009 Template Factory Singleton Iterator Adapter Façade Observer Command Strategy.
An object's behavior depends on its current state. Operations have large, multipart conditional statements that depend on the object's state.
Design Patterns: Behavioral Design Patterns General and reusable solutions to common problems in software design Software University
Overview of Behavioral Patterns ©SoftMoore ConsultingSlide 1.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
Jim Fawcett CSE776 – Design Patterns Summer 2006
Design Patterns: MORE Examples
Chapter 10 Design Patterns.
Software Design Patterns
MPCS – Advanced java Programming
Design Patterns Lecture part 2.
Introduction to Design Patterns
Behavioral Design Patterns
object oriented Principles of software design
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2005 Instructor: Patrice Chalin.
Presented by Igor Ivković
Design Patterns in Game Design
Informatics 122 Software Design II
Object Oriented Design Patterns - Behavioral Patterns
Introduction to Design Patterns
Design Patterns Lecture part 1.
Informatics 122 Software Design II
Presented by Igor Ivković
Presentation transcript:

Using Software Design Patterns Bill Anderson

About me Fox developer since 1987 Fox developer since 1987 Program Director, Los Angeles Visual Foxpro Developers Group (LAFox) Program Director, Los Angeles Visual Foxpro Developers Group (LAFox) Independent Consultant since 1991 Independent Consultant since 1991 SoCal speaker and author SoCal speaker and author

Design Patterns What are patterns? What are patterns? A solution to a problem in a context. A solution to a problem in a context. Similarities to architectural design issues. Similarities to architectural design issues.

Design Patterns Four elements to a design pattern Four elements to a design pattern Name Name When to apply pattern When to apply pattern Description of elements and responsibilities Description of elements and responsibilities Consequences of usage Consequences of usage You’re familiar with patterns! You’re familiar with patterns!

Bridge Pattern Definition: Decouple an abstraction from the implementation so the two can vary independently. Definition: Decouple an abstraction from the implementation so the two can vary independently. Fundamental design pattern Fundamental design pattern Three types of bridges Three types of bridges Reference bridges Reference bridges Multiple bridges Multiple bridges Aggregation bridges Aggregation bridges

Decorator Pattern Definition: Attach additional responsibilities to an object dynamically. Definition: Attach additional responsibilities to an object dynamically. Heuristic: Subclass all “black box” objects (VFP base classes, ActiveX controls, etc.) Heuristic: Subclass all “black box” objects (VFP base classes, ActiveX controls, etc.) Subclassed a control and changed its behavior? Then you know the pattern. Subclassed a control and changed its behavior? Then you know the pattern.

Adapter Pattern Definition: Convert the interface of a class into another interface clients expect. Definition: Convert the interface of a class into another interface clients expect. Adapters modify interfaces to an object (unlike Decorators, which modify behavior of an object). Makes an object look like another. Adapters modify interfaces to an object (unlike Decorators, which modify behavior of an object). Makes an object look like another.

Template Method Definition: Define the skeleton of an algorithm in an operation. Definition: Define the skeleton of an algorithm in an operation. Used to define a common sequence of events Used to define a common sequence of events Template methods contain Template methods contain Abstract operation methods Abstract operation methods Hook operations Hook operations

Iterator Pattern Definition: Provide a way to access elements of an aggregate object. Definition: Provide a way to access elements of an aggregate object. Means of traversal handled by iterator object. Means of traversal handled by iterator object. Should be a container. Should be a container. VFP collection class is ideal. VFP collection class is ideal. Similarities to traversing an array. Similarities to traversing an array.

Observer Pattern Definition: Define dependency between objects so that if state change, all dependents are notified. Definition: Define dependency between objects so that if state change, all dependents are notified. Two types of Observers Two types of Observers Active (Voyeur) Active (Voyeur) Passive (Publish and Subscribe) Passive (Publish and Subscribe)

Mediator Pattern Definition: Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling via one communication point. Definition: Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling via one communication point. Used to handle event notification. Used to handle event notification. Mediator is a form of a Passive Observer. Mediator is a form of a Passive Observer.

Memento Pattern Definition: Capture an object’s internal state so that the object can be restored. Definition: Capture an object’s internal state so that the object can be restored. Use this pattern for VFP housekeeping chores – SET settings, ON settings, work areas, etc. Use this pattern for VFP housekeeping chores – SET settings, ON settings, work areas, etc.

Chain of Responsibility Definition: Avoid coupling request sender to the receiver by giving more than one object a chance to handle the request. Chain the receiving objects. Definition: Avoid coupling request sender to the receiver by giving more than one object a chance to handle the request. Chain the receiving objects. Pattern often used in hierarchies – Error handling, processing import data, multi- tier applications, etc. Pattern often used in hierarchies – Error handling, processing import data, multi- tier applications, etc.

Chain of Responsibility

Abstract Factory Pattern Definition: Provide an interface for creating families of dependent objects without specifying their concrete classes. Definition: Provide an interface for creating families of dependent objects without specifying their concrete classes. Avoid NewObject and CreateObject methods – let Factory handle it. Avoid NewObject and CreateObject methods – let Factory handle it. VFP data access performance is ideal for implementing this pattern. VFP data access performance is ideal for implementing this pattern.

Summary Use Software Patterns to keep an application as flexible as possible. Use Software Patterns to keep an application as flexible as possible. Think in Patterns Think in Patterns You’re already familiar with most patterns. You’re already familiar with most patterns. Use pattern heuristics as a guideline. Use pattern heuristics as a guideline. Understand pattern usage. Understand pattern usage. Don’t get lost in formal definitions. Don’t get lost in formal definitions. Fox Wiki is a great resource Fox Wiki is a great resource

Thank you! Remember to fill out your session evaluation. Session slides, white paper, and code samples will not be updated.