CS 210 Introduction to Design Patterns September 26 th, 2006.

Slides:



Advertisements
Similar presentations
CS 221 Chapter 2 Excel. In Excel: A1 = 95 A2 = 95 A3 = 80 A4 = 0 =IF(A1
Advertisements

Our Quasi-Broadband Home. Dave’s PC Sandy’s PC Card scanner and camera.
Command Explained. Intent Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests,
Computer Science 313 – Advanced Programming Topics.
Command Pattern 1. Intent Encapsulates a request as an object, thereby letting you parameterize other objects with different requests, queue or log request,
March Ron McFadyen1 Command The command pattern encapsulates a request or unit of work into an object. An invoker will ask a concrete command.
Design Patterns In OPM Presented by: Galia Shlezinger Instructors: Prop. Dov Dori, Dr. Iris Berger.
Software Design & Documentation – Design Pattern: Command Design Pattern: Command Christopher Lacey September 15, 2003.
Spring 2010ACS-3913 Ron McFadyen1 Command The complex remote control (many pairs of buttons; null command) Undo … pages 216+ Macro … pages 224+
Feb Ron McFadyen1 Adapter An adapter converts the interface of a class into another interface the client expects. An adapter lets classes work.
Command Pattern Chihung Liao Cynthia Jiang. Waiter Order Execute() Hamburger Execute() Hot Dogs Execute() Fries Execute() Cook Make Food()
Spring 2010ACS-3913 Ron McFadyen1 Command The command pattern encapsulates a request or unit of work into an object. An invoker will ask a concrete command.
March Ron McFadyen1 Singleton pattern Singleton is designed to restrict instantiation of a class to one (or a few) objects. Useful when exactly.
GoF Sections 2.7 – 2.9 More Fun with Lexi. Lexi Document Editor Lexi tasks discussed:  Document structure  Formatting  Embellishing the user interface.
Command Pattern When Actions Speak Louder Than Words.
© 2004 Control 4 August 4, 2015 Control4 Get the most out of your home.
C ONTENTS 1-Introduction What are smart homes 2-Why smart homes 3- Applications of smart homes 4- The main objective of the project 5- The main phases.
Gaylen Atkinson March 16, AGENDA Market Potential Customer Need Tridium Solution Benefits to Users Customer “Hot” Buttons Product Offerings How.
CS 350 – Software Design Command Object Remote Control Object.
A Home Automation Program Eric McGregor. Subject Area ● We have appliances in our dorm rooms and home. – Stereo – Computer – Lamps – Fans ● All appliances.
Behavioral Patterns  Behavioral patterns are patterns whose purpose is to facilitate the work of algorithmic calculations and communication between classes.
Peter Browne. What do I mean? Villages homes are poorly wired for 21 st Century Technology Using existing wiring, a little creativity and a few inexpensive.
DEC0905 Remote Control of Home Appliances ABSTRACT The objective of this project is to enable users to remotely control home appliances and systems over.
Project Presentation Supervisor:Prof Dr Zubair Ahmad Khan Group : Inaamul-Haq-Mansoor (Leader) (S454845) Nadeem (S454843) Kamran Khaliq (S455118) Ghulam.
CS 210 Introduction to Design Patterns September 28 th, 2006.
Design Pattern. The Observer Pattern The Observer Pattern defines a one-to-many dependency between objects so that when one object changes state, all.
CS 415 N-Tier Application Development By Umair Ashraf June 21,2013 National University of Computer and Emerging Sciences Lecture # 2 Introduction to Design.
Behavioral Pattern: Command C h a p t e r 5 – P a g e 139 There are times when the need arises to issue a request to an object without knowing anything.
Command. RHS – SOC 2 Executing a command Executing a command appears simple at first, but many details to consider: –Who creates a command? –Who invokes.
1 Command Design Pattern Rick Mercer and Rice University.
Home Automation Right arrow to continue. What Is It? Turning devices on and off remotely Scheduling devices to operate according to a pre-programmed routine.
Lexi case study (Part 2) Presentation by Matt Deckard.
CS 210 Adapter Pattern October 19 th, Adapters in real life Page 236 – Head First Design Patterns.
1 Command Design Pattern Rick Mercer. Command Design Pattern The Command Pattern encapsulates a request as an object, thereby letting you queue commands,
Linzhang Wang Dept. of Computer Sci&Tech, Nanjing University The Command Pattern.
Computer Science 313 – Advanced Programming Topics.
CS 210 Review Session October 5 th, Head First Design Patterns Chapter 4 Factory Pattern.
Remote Control of Home Appliances PROJECT PLAN Team: ◦ Elie Abichar –CE ◦ Chris Tefer –CE ◦ Ananta Upadhyaya.
BEHAVIORAL PATTERNS 13-Sep-2012 Presenters Sanjeeb Kumar Nanda & Shankar Gogada.
Working “Control any electrical device with your T.V remote(any brand)” wizardelectronics.weebly.com.
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:
Chapter 8 Object Design Reuse and Patterns. More Patterns Abstract Factory: Provide manufacturer independence Builder: Hide a complex creation process.
I Like Ike I have always found that plans are useless, but planning is indispensable.
I can run this simple BAT file to copy files: (this was tried with and without the pause command)
Five Minute Design Patterns Doug Marttila Forest and the Trees May 30, 2009 Template Factory Singleton Iterator Adapter Façade Observer Command Strategy.
The Command Pattern SE-2811 Dr. Mark L. Hornick 1.
Command. RHS – SWC 2 Executing a command Executing a command appears simple at first, but many details to consider: –Who creates a command? –Who invokes.
Command Pattern Encapsulation Invocation. One size fits all.
HOME AUTOMATION Robert Brandenburg EKU, Dept. of Technology, CEN/CET.
Overview of Behavioral Patterns ©SoftMoore ConsultingSlide 1.
Automated Home Control Nick Atkinson Matt Majeika Ungku Afiq Ungku Farid Sponsor: Terry Slattery 03/18/
Command Pattern. Intent encapsulate a request as an object  can parameterize clients with different requests, queue or log requests, support undoable.
Programming with Patterns Jeremy Cronan Alliance Safety Council
Prototyping Home Automation Concepts
Sensors Control Systems with Flowol.
Façade Pattern:.
Behavioral Design Patterns
Home Automation Automation Examples
Command Pattern.
Control Systems An Overview Computer Integrated Manufacturing
Programming Design Patterns
Command Pattern 1.
Command Design Pattern
Group 16 Tarek Kaddoura Jigar Nahar
Control Systems An Overview Computer Integrated Manufacturing
Chapter 1: Introduction
PH Chapter 3 Thanks for the Memory Leaks Pushme-Pullyu (pp
The Command Design Pattern
4 Step Simple Diagram Sample text Sample text Sample text Sample text
Presentation transcript:

CS 210 Introduction to Design Patterns September 26 th, 2006

Head First Design Patterns Chapter 6 Command Pattern Encapsulating Invocation

Motivating problem description Build a remote that will control variety of home devices Sample devices: lights, stereo, TV, ceiling light, thermostat, sprinkler, hot tub, garden light, ceiling fan, garage door

Introducing the command pattern – Diner example Burger & Shake Order takeOrderorderUp Make Burger & Shake createOder() takeOder() orderUp() make_X()

Introducing the command pattern Create Command Object execute()setCommandexecute() action1 action2 creatCommandObject() setCommand() execute() action_X()

Command Pattern for home automation action() execute(){ receiver.action() } execute() An encapsulated Request Invoker

Simple Remote Control Eclipse example

Command Pattern defined The Command Pattern encapsulates a request as an object, thereby letting you parameterize other objects with different requests, queue or log requests, and support undoable operations.

Command Pattern Class Diagram ClientInvoker setCommand() > Command execute() undo() Receiver action() ConcreteCommand execute() undo()

Command Pattern Class Diagram for Home automation RemoteLoader RemoteControl onCommands offCommands setCommand() onButtonPushed() offButtonPushed() > Command execute() undo() Light on() off() LightOnCommand execute() undo() LightOffCommand execute() undo()