Command Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.

Slides:



Advertisements
Similar presentations
Introduction to Computers Section 6A. home The Operating System (OS) The operating system (OS) is software that controls the interaction between hardware.
Advertisements

Windows Basics An Introduction to the Windows Operating System.
Designing a Graphical User Interface (GUI) 10 IST – Topic 6.
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
XP Exploring the Basics of Microsoft Windows XP1 Exploring the Basics of Windows XP.
Automating Tasks With Macros
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.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
Exploring the Basics of Windows XP. Objectives Start Windows XP and tour the desktop Explore the Start menu Run software programs, switch between them,
Spring 2010CS 2251 Design Patterns. Spring 2010CS 2252 What is a Design Pattern? "a general reusable solution to a commonly occurring problem in software.
XP New Perspectives on Microsoft Office Word 2003 Tutorial 1 1 Microsoft Office Word 2003 Tutorial 1 – Creating a Document.
XP 1 Microsoft Office Word 2003 Tutorial 1 – Creating a Document.
Façade Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Part two. 3.2 operating system architecture  Software have two categories  Application software  System software  Application software: consists of.
Applications Software
Exploring the Basics of Windows XP
Proxy Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Access Tutorial 10 Automating Tasks with Macros
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
Computer for Health Sciences
Operating system Part two Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information.
Observer Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Welcome to CIS 083 ! Events CIS 068.
Event Driven Programming
Unit 1_9 Human Computer Interface. Why have an Interface? The user needs to issue instructions Problem diagnosis The Computer needs to tell the user what.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
Design Patterns Part two. Structural Patterns Concerned with how classes and objects are composed to form larger structures Concerned with how classes.
Word Lesson 2 Basic Editing
XP New Perspectives on Windows XP Tutorial 1 Exploring the Basics.
Copyright © 2010 Wolters Kluwer Health | Lippincott Williams & Wilkins Introduction to Windows Chapter 2.
Automating Database Processing
Key Applications Module Lesson 21 — Access Essentials
Introduction to Computer in Technology. Internet Discovery Were going to define several terms that are common in Computers and Technology One way to find.
Lexi case study (Part 2) Presentation by Matt Deckard.
Chain of Responsibility Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
Microsoft Office XP Illustrated Introductory, Enhanced Started with Windows 2000 Getting.
Linzhang Wang Dept. of Computer Sci&Tech, Nanjing University The Command Pattern.
Lesson No: 6 Introduction to Windows XP CHBT-01 Basic Micro process & Computer Operation.
Graphical User Interface You will be used to using programs that have a graphical user interface (GUI). So far you have been writing programs that have.
P6 BTEC Level 3 Subsidiary Diploma in ICT. Automation The end user of a spreadsheet may be proficient in using the software, but the more that you automate.
Chapter Three The UNIX Editors.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
Catholic University College of Ghana Fiapre-Sunyani INFORMATION TECHNOLOGY I Audrey Asante, Faculty of ICST Graphic User Interface Tutorials and Documentation.
INFORMATION SYSTEM – SOFTWARE TOPIC: GRAPHICAL USER INTERFACE.
1 After completing this lesson, you will be able to: Open a file. Navigate through a document. Scroll through a document. Insert text in a document. Select.
Command Buttons in Access Forms. What are Command Buttons?  Buttons that perform commands (duh)  With proper programming, you can make a button perform.
The Command Pattern SE-2811 Dr. Mark L. Hornick 1.
Chapter 4 Helpful Tips and Navigation. OBJECTIVES Identify the common elements on a MedTrak screen Use the function keys Use the Tab key Select an item.
XP New Perspectives on Microsoft Windows XP Tutorial 1 1 Microsoft Windows XP Creating a Web Site Tutorial 1.
Word processing is the software package that enables you to create,edit, print and save documents for future retrieval reference. creating a document.
Command Pattern. Intent encapsulate a request as an object  can parameterize clients with different requests, queue or log requests, support undoable.
Pasewark & Pasewark 1 Windows Vista Lesson 1 Windows Vista Basics Microsoft Office 2007: Introductory.
Software Design Refinement Using Design Patterns
Turning method call into an object
The Desktop Screen image displayed when a PC starts up A metaphor
Program and Graphical User Interface Design
Note 11 Command Pattern SE2811 Software Component Design
Program and Graphical User Interface Design
12. Command Pattern SE2811 Software Component Design
Windows xp PART 1 DR.WAFAA SHRIEF.
Exploring the Basics of Windows XP
Composite Pattern Context:
GRAPHICAL USER INTERFACE
12. Command Pattern SE2811 Software Component Design
MVC overview Model, View, Controller is MVC
Software Engineering and Architecture
Presentation transcript:

Command Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.

Problem Sometimes a class needs to perform actions without knowing what the actions are

Example: GUI Toolkit A GUI toolkit provides a full complement of components –Buttons, scroll bars, text boxes, menus, etc. Toolkit components know how to draw themselves on the screen, but they don't know how to perform application logic Application developers need a way to associate application logic with GUI components –What should happen when a button is pressed? –What should happen when a menu item is selected? GUI components need to perform an unknown operation when they are activated by the user

Solution

Consequences Completely decouples objects from the actions they execute Objects can be parameterized with arbitrary actions Adding new kinds of actions is easy –Just create a new class that implements the Command interface

Known Uses: Task Scheduling Service Generic task scheduling service allow tasks to be scheduled by –Interval (e.g., every hour) –Date/time (e.g., on February 8 th at 1:00pm) –Etc. Tasks are defined using Command objects Scheduling service executes Command object at the appropriate time, having no idea what it actually does

Known Uses: Undo/Redo Store a list of actions performed by the user Each action has –A “do” method that knows how to perform the action –An “undo” method that knows how to reverse the action Store a pointer to the most recent action performed by the user Undo – “undo” the current action and back up the pointer Redo – move the pointer forward and “redo” the current action

Known Uses: Recording user actions Macros –Record a sequence of user actions so they can be turned into a macro –Macro can be re-executed on demand by the user

Known Uses: Multi-user network games Actions performed by a player must be broadcast to all other players and executed on their local machines How could we use the Command pattern to do this?