Strategy Design Pattern

Slides:



Advertisements
Similar presentations
Things to mention public static void main(String [] args) –The starting point for a free-standing Java application (i.e. one not run from the DrJava interactions.
Advertisements

1 Patterns & GUI Programming Part 2. 2 Creating a Custom Layout Manager Layout manager determines how components are arranged/displayed in a container.
Spring 2010CS 2251 Design Patterns. Spring 2010CS 2252 What is a Design Pattern? "a general reusable solution to a commonly occurring problem in software.
Design patterns Observer,Strategi, Composite,Template (Chap 5, 6)
Danny gallardo. Operating systems An operating system (OS) is a collection of software that manages computer hardware resources and provides common services.
CE0825 Object-Oriented Programming 2 © Allan C. Milne Abertay University v
Design Patterns and Graphical User Interfaces Horstmann ,
Case Studies on Design Patterns Design Refinements Examples.
computer
1 CSC111H Graphical User Interfaces (GUIs) Introduction GUIs in Java Understanding Events A Simple Application The Containment Hierarchy Layout Managers.
Software Design 8.1 Model, View, Controller: battleship l Who does what, where are responsibilities in MVC?  This is a pattern, so there's isn't "one.
Software Design 5.1 From Using to Programming GUIs l Extend model of "keep it simple" in code to GUI  Bells and whistles ok, but easy to use and hide.
Chapter 1 The Product Software is
Linzhang Wang Dept. of Computer Sci&Tech, Nanjing University The Strategy Pattern.
Introduction to Video Game Programming (VGP) Mr. Shultz.
GUIs Graphical User Interfaces. Everything coming together Known: – Inheritance – Interfaces – Abstract classes – Polymorphism – Exceptions New: – Events.
CS 151: Object-Oriented Design October 15 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
CS 415 N-Tier Application Development By Umair Ashraf June 25,2013 National University of Computer and Emerging Sciences Lecture # 4 Web Presentation Patterns.
The Strategy Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
STRATEGY PATTERN By Michelle Johnson. BACKGROUND Behavioral Pattern Allow you to define a family of algorithms, encapsulate each one, and make them interchangeable.
Review IS Overview: Data  Inside the application Collections  Outside the application Database XML  Getting/displaying Swing  Communicating.
Introduction to Swing Mr. Crone. What is Swing? a collection of pre-made Java classes used to create a modern graphical user interface.
Introduction to Swing Mr. Crone. What is Swing? a collection of pre-made Java classes used to create a modern graphical user interface.
What Do Computers Do? A computer system is
OOP - Object Oriented Programming
Design Patterns: MORE Examples
Object-Oriented Design
Strategy Design Pattern
Strategy Pattern Jim Fawcett CSE776 – Design Patterns Fall 2014.
Chapter 5 – Design and Implementation
An Airports Policy ? Why are we losing airports?
Introduction to Design Patterns
Chapter Nine The Strategy Pattern
Design Patterns Damian Gordon.
Tim McKenna Layout Mangers in Java Tim McKenna
Java Interfaces: Using an Interface to Accomplish a Specific Goal
Java Interfaces: Using an Interface to Accomplish a Specific Goal
Types of Risk.
Software Usability and Design
Event Driven Programming and Graphical User Interface
Figure 11.1 A basic personal computer system
Object-Oriented Design
LESSON 11 – WHILE LOOPS UNIT 5 – 1/10/17.
Tim McKenna Layout Mangers in Java Tim McKenna
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
The AWT (versus Swing Components)
Derivative of a Function
Operating Systems Bina Ramamurthy CSE421 11/27/2018 B.Ramamurthy.
<<interface>> Strategy
Composite Pattern Context:
08/15/09 Decorator Pattern Context: We want to enhance the behavior of a class, and there may be many (open-ended) ways of enhancing the class. The enhanced.
Design and Implementation
Chapter 0 : Introduction to Object Oriented Design
JButton – Container Layout & Icons
Alphabet Bingo BINGO r g j l o d h s i n m f b y w q e BINGO f j s g m
CS 350 – Software Design Principles and Strategies – Chapter 14
Steps to Creating a GUI Interface
Strategy Design Pattern
The Game of Open Access: making mandates more memorable
VCE IT Theory Slideshows
Model, View, Controller design pattern
Computational Thinking
Design Patterns (Gamma, Helm, Johnson, Vlissides)
CS114B Introduction to Computer Science II
Derivative of a Function
Activity 1 - Chapter 5 -.
Do you think that computers should be included as art and if so why?
Call and return architectures
CS 151: Object-Oriented Design October 8 Class Meeting
Strategy Pattern Jim Fawcett CSE776 – Design Patterns Fall 2014.
Presentation transcript:

Strategy Design Pattern B.Ramamurthy 2/28/2019 B.Ramamurthy

Strategy Often there are alternative ways or strategies to achieve a goal. These strategies are usually realized using algorithms. Only one of them may be used depending on the context. The algorithms representing the strategies can be encapsulated each in a class. Strategy pattern itself represents a collection of these alternative ways in a hierarchy of classes, each class representing an alternative. 2/28/2019 B.Ramamurthy

Strategy Design 2/28/2019 B.Ramamurthy

Examples Different layouts for graphical components (JFrame, JPanel, JApplet) Checkout counter software has TaxCalculator class. Depending on the place (context) the tax computation differs. Mr.X’s strategies in the ScotlandYard game. 2/28/2019 B.Ramamurthy

Mr.X and Strategy Design Pattern 2/28/2019 B.Ramamurthy

Layout Example 2/28/2019 B.Ramamurthy