Software Quality Management

Size: px
Start display at page:

Download "Software Quality Management"

Transcription

1 Marco Scotto

2 Outline Behavioral Patterns Chain of Responsibility Command 2

3 Design Pattern Space Purpose Creational Structural Behavioral Scope Class Factory Method Adapter Interpreter Template Method Object Abstract Factory Adapter Chain of Responsibility Builder Bridge Command Prototype Composite Iterator Singleton Decorator Mediator Façade Memento Proxy Flyweight Observer State Strategy Visitor 3

4 Chain of Responsibility (1/2) Intent Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request Chain the receiving objects and pass the request along the chain until an object handles it 4

5 Chain of Responsibility (2/2) Motivation Consider a context-sensitive help system for a GUI The object that ultimately provides the help isn't known explicitly to the object (e.g., a button) that initiates the help request So use a chain of objects to decouple the senders from the receivers. The request gets passed along the chain until one of the objects handles it Each object on the chain shares a common interface for handling requests and for accessing its successor on the chain 5

6 Motivation 6

7 Applicability Use Chain of Responsibility: When more than one object may handle a request and the actual handler is not know in advance When requests follow a handle or forward model Some requests can be handled where they are generated while others must be forwarded to another object to be handled 7

8 Consequences Reduced coupling between the sender of a request and the receiver the sender and receiver have no explicit knowledge of each other Receipt is not guaranteed A request could fall off the end of the chain without being handled The chain of handlers can be modified dynamically 8

9 Structure (1/2) 9

10 Structure (2/2) A typical object structure might look like this: 10

11 Chain of Responsibility Example 1 (1/7) Scenario The designers of a set of GUI classes need to have a way to propagate GUI events, such as MOUSE_CLICKED, to the individual component where the event occurred and then to the object or objects that are going to handle the event 11

12 Chain of Responsibility Example 1 (2/7) Solution Use the Chain of Responsibility pattern. First post the event to the component where the event occurred. That component can handle the event or post the event to its container component (or both). The next component in the chain can again either handle the event or pass it up the component containment hierarchy until the event is handled This technique was actually used in the Java 1.0 AWT 12

13 Chain of Responsibility Example 1 (3/7) Here's a typical Java 1.0 AWT event handler: public boolean action(event event, Object obj) { if (event.target == test_button) dotestbuttonaction(); else if (event.target == exit_button) doexitbuttonaction(); else return super.action(event,obj); return true; // Return true to indicate the event has been // handled and should not be propagated further. 13

14 Chain of Responsibility Example 1 (4/7) In Java 1.1 the AWT event model was changed from the Chain of Responsibility pattern to the Observer pattern Why? 14

15 Chain of Responsibility Example 1 (5/7) Efficiency GUIs frequently generate many events, such as MOUSE_MOVE events. In many cases, the application did not care about these events. Yet, using the Chain of Responsibility pattern, the GUI framework would propagate the event up the containment hierarchy until some component handled it This caused the GUI to slow noticeably 15

16 Chain of Responsibility Example 1 (6/7) Flexibility The Chain of Responsibility pattern assumes a common Handler superclass or interface for all objects which can handle chained requests. In the case of the Java 1.0 AWT, every object that could handle an event had to be a subclass of the Component class Thus, non-gui events could not be handled, limiting the flexibility of the program 16

17 Chain of Responsibility Example 1 (7/7) The Java 1.1 AWT event model uses the Observer pattern Any object that wants to handle an event registers as an event listener with a component. When an event occurs, it is posted to the component. The component then dispatches the event to any of its listeners. If the component has no listeners, the event is discarded For this application, the Observer pattern is more efficient and more flexible 17

18 Chain of Responsibility Example 2 (1/2) Scenario We are designing the software for a security monitoring system. The system uses various sensors (smoke, fire, motion, etc.) which transmit their status to a central computer. We decide to instantiate a sensor object for each physical sensor. Each sensor object knows when the value it is sensing exceeds some threshold(s). When this happens, the sensor object should take some action. But the action that should be taken may depend on factors other than just the sensor's value. For example, the location of the sensor, the value of the data or equipment located at the sensor s position, the value of the data or equipment in other locations near the sensor s position, etc. We want a very scalable solution in which we can use our physical sensors and sensor objects in any environment What can be do? 18

19 Chain of Responsibility Example 2 (2/2) Solution Use the Chain of Responsibility pattern Aggregate sensor objects in a containment hierarchy that mirrors the required physical zones (areas) of security. Define wall, room, floor, area, building, campus and similar objects as part of this containment hierarchy. The alarm generated by a sensor is passed up this hierarchy until some containment object handles it 19

20 Chain of Responsibility Example 3 (1/2) Scenario We are designing the software for a system that approves purchasing requests. The approval authority depends on the dollar amount of the purchase. The approval authority for a given dollar amount could change at any time and the system should be flexible enough to handle this situation 20

21 Chain of Responsibility Example 3 (2/2) Solution Use the Chain of Responsibility pattern. PurchaseRequest objects forward the approval request to a PurchaseApproval object. Depending on the dollar amount, the PurchaseApproval object may approve the request or forward it on to the next approving authority in the chain. The approval authority at any level in the chain can be easily modified without affecting the original PurchaseRequest object 21

22 Handling Requests (1/10) Notice in the basic structure for the Chain of Responsibility pattern that the Handler class just has one method, handlerequest() Here it is as a Java interface: public interface Handler { public void handlerequest(); What if we want to handle different kinds of requests, for example, help, print and format requests? 22

23 Handling Requests (2/10) Solution 1 We could change our Handler interface to support multiple request types as follows: public interface Handler { public void handlehelp(); public void handleprint(); public void handleformat(); Now any concrete handler would have to implement all of the methods of this Handler interface 23

24 Handling Requests (3/10) Here's an example of a concrete handler for this new Handler interface: public class ConcreteHandler implements Handler { private Handler successor; public ConcreteHandler(Handler successor) { this.successor = successor; public void handlehelp() { // We handle help ourselves, so help code is here. public void handleprint() { successor.handleprint(); 24

25 Handling Requests (4/10) public void handleformat() { successor.handleformat(); The only problem with this technique is that if we add a new kind of request we need to change the interface which means that all concrete handlers need to be modified 25

26 Handling Requests (5/10) Solution 2 A better solution is to have separate handler interfaces for each type of request. For example, we could have: public interface HelpHandler { public void handlehelp(); public interface PrintHandler { public void handleprint(); public interface FormatHandler { public void handleformat(); 26

27 Handling Requests (6/10) Now a concrete handler can implement one (or more) of these interfaces. The concrete handler must have successor references to each type of request that it deals with, in case it needs to pass the request on to its successor 27

28 Handling Requests (7/10) Here's a concrete handler which deals with all three request types: public class ConcreteHandler implements HelpHandler, PrintHandler, FormatHandler { private HelpHandler helpsuccessor; private PrintHandler printsuccessor; private FormatHandler formatsuccessor; public ConcreteHandler(HelpHandler helpsuccessor PrintHandler printsuccessor, FormatHandler formatsuccessor) { this.helpsuccessor = helpsuccessor; this.printsuccessor = printsuccessor; this.formatsuccessor = formatsuccessor; 28

29 Handling Requests (8/10) public void handlehelp() { // We handle help ourselves, so help code is here. public void handleprint() { printsuccessor.handleprint(); public void handleformat() { formatsuccessor.handleformat(); 29

30 Handling Requests (9/10) Solution 3: Another approach to handling different kinds of requests is to have a single method in the Handler interface which takes an argument describing the type of request. For example, we could describe the request as a String: public interface Handler { public void handlerequest(string request); 30

31 Handling Requests (10/10) And now our concrete handler looks like: public class ConcreteHandler implements Handler { private Handler successor; public ConcreteHandler(Handler successor) { this.successor = successor; public void handlerequest(string request) { if (request.equals("help")) { // We handle help ourselves, so help code is here. else // Pass it on! successor.handle(request); 31

32 Command Intent Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations Also Known As Action, Transaction 32

33 Motivation (1/3) 33

34 Motivation (2/3) 34

35 Motivation (3/3) 35

36 Structure 36

37 Applicability Use the Command pattern when You want to implement a callback function capability You want to specify, queue, and execute requests at different times You need to support undo and change log operations 37

38 Collaborations 38

39 Consequences (1/2) Command decouples the object that invokes the operation from the one that knows how to perform it Commands are first-class objects. They can be manipulated and extended like any other object Commands can be made into a composite command 39

40 Consequences (2/2) 40

41 Implementation Issues (1/2) How intelligent should a command object be? Dumb: Delegates the required action to a receiver object Smart: Implements everything itself without delegating to a receiver object at all 41

42 Implementation Issues (2/2) A functor object usually implements the desired behavior itself without delegation to another object. A command object frequently delegates the desired behavior to another receiver object If the command object simply implements the desired behavior itself, it is acting as a simple functor 42

43 Command Pattern Example 1 (1/4) Situation A GUI system has several buttons that perform various actions. We want to have menu items that perform the same action as its corresponding button 43

44 Command Pattern Example 1 (2/4) Solution 1 Have one action listener for all buttons and menu items This is not a good solution as the resulting actionperformed() method violates the Open- Closed Principle 44

45 Command Pattern Example 1 (3/4) Solution 2 Have an action listener for each paired button and menu item. Keep the required actions in the actionperformed() method of this one action listener. This solution is essentially the Command pattern with simple ConcreteCommand classes that perform the actions themselves, acting like functors In Java 2, Swing Action objects are used for this purpose 45

46 Command Pattern Example 1 (4/4) 46

47 Swing Actions (1/4) A Swing Action object is really just an ActionListener object that not only provides the ActionEvent handling, but also centralized handling of the text, icon, and enabled state of toolbar buttons or menu items The same Action object can easily be associated with a toolbar button and a menu item 47

48 Swing Actions (2/4) The Action object also maintains the enabled state of the function associated with the toolbar button or menu item and allows listeners to be notified when this functionality is enabled or disabled 48

49 Swing Actions (3/4) In addition to the actionperformed method defined by the ActionListener interface, objects that implement the Action interface provide methods that allow the specification of: One or more text strings that describe the function of the button or menu item One or more icons that depict the function The enabled/disabled state of the functionality 49

50 Swing Actions (4/4) By adding an Action to a JToolBar or JMenu, you get: A new JButton (for JToolBar) or JMenuItem (for JMenu ) that is automatically added to the tool bar or menu. The button or menu item automatically uses the icon and text specified by the Action A registered action listener (the Action object) for the button or menu item Centralized handling of the button's or menu item's enabled state 50

51 Swing Actions Example (1/4) /** * Class SwingActions demonstrates the Command Pattern * using Swing Actions. */ public class SwingActions extends JFrame { private JToolBar tb; private JTextArea ta; private JMenu filemenu; private Action openaction; private Action closeaction; public SwingActions() { super("swingactions"); setupgui(); 51

52 Swing Actions Example (2/4) private void setupgui() { //Create the toolbar and menu. tb = new JToolBar(); filemenu = new JMenu("File"); //Create the text area used for output. ta = new JTextArea(5, 30); JScrollPane scrollpane = new JScrollPane(ta); //Layout the content pane. JPanel contentpane = new JPanel(); contentpane.setlayout(new BorderLayout()); contentpane.setpreferredsize(new Dimension(400, 150)); contentpane.add(tb, BorderLayout.NORTH); contentpane.add(scrollpane, BorderLayout.CENTER); setcontentpane(contentpane); 52

53 Swing Actions Example (3/4) //Set up the menu bar. JMenuBar mb = new JMenuBar(); mb.add(filemenu); setjmenubar(mb); // Create an action for "Open". ImageIcon openicon = new ImageIcon("open.gif"); openaction = new AbstractAction("Open", openicon) { public void actionperformed(actionevent e) { ta.append("open action from " + e.getactioncommand() +"\n"); ; // Use the action to add a button to the toolbar. JButton openbutton = tb.add(openaction); openbutton.settext(""); openbutton.setactioncommand("open Button"); openbutton.settooltiptext("this is the open button"); 53

54 Swing Actions Example (4/4) // Use the action to add a menu item to the file menu. JMenuItem openmenuitem = filemenu.add(openaction); openmenuitem.seticon(null); openmenuitem.setactioncommand("open Menu Item"); // Create an action for "Close" and use the action to add // a button to the toolbar and a menu item to the menu. // Code NOT shown - similar to "open" code above. public static void main(string[] args) { SwingActions frame = new SwingActions(); frame.pack(); frame.setvisible(true); 54

55 Command Pattern Example 2 (1/12) Scenario We want to write a class that can periodically execute one or more methods of various objects. For example, we want to run a backup operation every hour and a disk status operation every ten minutes. But we do not want the class to know the details of these operations or the objects that provide them. We want to decouple the class that schedules the execution of these methods with the classes that actually provide the behavior we want to execute 55

56 Command Pattern Example 2 (2/12) Solution: Command Pattern Here s the Task interface: public interface Task { public void performtask(); 56

57 Command Pattern Example 2 (3/12) Instead of a BackupTask or DiskStatusClass, here is a simple Fortune Teller Task which cycles through a list of fortune sayings: public class FortuneTask implements Task { int nextfortune = 0; String[] fortunes = {"She who studies hard, gets A", Seeth the pattern and knoweth the truth", "He who leaves state the day after final, graduates not" ; public FortuneTask() { public void performtask() { System.out.println("Your fortune is: " + fortunes[nextfortune]); nextfortune = (nextfortune + 1) % fortunes.length; public String tostring() { return ("Fortune Telling Task"); 57

58 Command Pattern Example 2 (4/12) And here is a Fibonacci Sequence Task which generates a sequence of Fibonacci numbers: public class FibonacciTask implements Task { int n1 = 1; int n2 = 0; int num; public FibonacciTask() { public void performtask() { num = n1 + n2; System.out.println("Next Fibonacci number is: " + num); n1 = n2; n2 = num; public String tostring() { return ("Fibonacci Sequence Task"); 58

59 Command Pattern Example 2 (5/12) Here is the TaskEntry class: public class TaskEntry { private Task task // The task to be done // It's a Command object! private long repeatinterval; // How often task should be // executed private long timelastdone; // Time task was last done public TaskEntry(Task task, long repeatinterval) { this.task = task; this.repeatinterval = repeatinterval; this.timelastdone = System.currentTimeMillis(); public Task gettask() { return task; 59

60 Command Pattern Example 2 (6/12) public void settask(task task) { this.task = task; public long getrepeatinterval() { return repeatinterval; public void setrepeatinterval(long ri) { this.repeatinterval = ri; public long gettimelastdone() { return timelastdone; public void settimelastdone(long t) { this.timelastdone = t; public String tostring() { return (task + " to be done every " + repeatinterval + " ms; last done " + timelastdone); 60

61 Command Pattern Example 2 (7/12) Here is the TaskMinder class: public class TaskMinder extends Thread { private long sleepinterval; // How often the TaskMinder // should check for tasks to be run private Vector tasklist; // The list of tasks public TaskMinder(long sleepinterval, int maxtasks) { this.sleepinterval = sleepinterval; tasklist = new Vector(maxTasks); start(); public void addtask(task task, long repeatinterval) { long ri = (repeatinterval > 0)? repeatinterval : 0; TaskEntry te = new TaskEntry(task, ri); tasklist.addelement(te); 61

62 Command Pattern Example 2 (8/12) public Enumeration gettasks() { return tasklist.elements(); public long getsleepinterval() { return sleepinterval; public void setsleepinterval(long si) { this.sleepinterval = si; public void run() { while (true) { try { sleep(sleepinterval); long now = System.currentTimeMillis(); Enumeration e = tasklist.elements(); 62

63 Command Pattern Example 2 (9/12) while (e.hasmoreelements()) { TaskEntry te = (TaskEntry) e.nextelement(); if (te.getrepeatinterval() + te.gettimelastdone() < now) { te.gettask().performtask(); te.settimelastdone(now); catch (Exception e) { System.out.println("Interrupted sleep: " + e); 63

64 Command Pattern Example 2 (10/12) Test program: public class TestTaskMinder { public static void main(string args[]) { // Create and start a TaskMinder. // This TaskMinder checks for things to do every 500 ms // and allows a maximum of 100 tasks. TaskMinder tm = new TaskMinder(500, 100); // Create a Fortune Teller Task. FortuneTask fortunetask = new FortuneTask(); // Have the Fortune Teller execute every 3 seconds. tm.addtask(fortunetask, 3000); 64

65 Command Pattern Example 2 (11/12) // Create a Fibonacci Sequence Task. FibonacciTask fibonaccitask = newfibonaccitask(); // Have the Fibonacci Sequence execute every 700 // milliseconds. tm.addtask(fibonaccitask, 700); 65

66 Command Pattern Example 2 (12/12) Test program output: Next Fibonacci number is: 1 Next Fibonacci number is: 1 Your fortune is: She who studies hard, gets A Next Fibonacci number is: 2 Next Fibonacci number is: 3 Next Fibonacci number is: 5 Next Fibonacci number is: 8 Your fortune is: Seeth the pattern and knoweth the truth Next Fibonacci number is: 13 Next Fibonacci number is: 21 Next Fibonacci number is: 34 Your fortune is: He who leaves state the day after final, graduates not Next Fibonacci number is: 55 Next Fibonacci number is: 89 Next Fibonacci number is: 144 etc. 66

The Chain of Responsibility Pattern

The Chain of Responsibility Pattern The Chain of Responsibility Pattern The Chain of Responsibility Pattern Intent Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain

More information

The Chain of Responsibility Pattern. Design Patterns In Java Bob Tarr

The Chain of Responsibility Pattern. Design Patterns In Java Bob Tarr The Chain of Responsibility Pattern The Chain of Responsibility Pattern Intent Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain

More information

COSC 3351 Software Design. Design Patterns Behavioral Patterns (I)

COSC 3351 Software Design. Design Patterns Behavioral Patterns (I) COSC 3351 Software Design Design Patterns Behavioral Patterns (I) Spring 2008 Purpose Creational Structural Behavioral Scope Class Factory Method Adapter(class) Interpreter Template Method Object Abstract

More information

EPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 6: Design Patterns

EPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 6: Design Patterns EPL 603 TOPICS IN SOFTWARE ENGINEERING Lab 6: Design Patterns Links to Design Pattern Material 1 http://www.oodesign.com/ http://www.vincehuston.org/dp/patterns_quiz.html Types of Design Patterns 2 Creational

More information

SDC Design patterns GoF

SDC Design patterns GoF SDC Design patterns GoF Design Patterns The design pattern concept can be viewed as an abstraction of imitating useful parts of other software products. The design pattern is a description of communicating

More information

Design Pattern. CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.)

Design Pattern. CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.) Design Pattern CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.) A. Design Pattern Design patterns represent the best practices used by experienced

More information

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar Design Patterns MSc in Communications Software Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie

More information

CSE 219 COMPUTER SCIENCE III BEHAVIORAL DESIGN PATTERNS SLIDES COURTESY: RICHARD MCKENNA, STONY BROOK UNIVERSITY

CSE 219 COMPUTER SCIENCE III BEHAVIORAL DESIGN PATTERNS SLIDES COURTESY: RICHARD MCKENNA, STONY BROOK UNIVERSITY CSE 219 COMPUTER SCIENCE III BEHAVIORAL DESIGN PATTERNS SLIDES COURTESY: RICHARD MCKENNA, STONY BROOK UNIVERSITY Behavioral Design Pattern These design patterns are specifically concerned with communication

More information

The Strategy Pattern Design Principle: Design Principle: Design Principle:

The Strategy Pattern Design Principle: Design Principle: Design Principle: Strategy Pattern The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it. Design

More information

» Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request!

» Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request! Chain of Responsibility Pattern Behavioural! Intent» Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request!» Chain the receiving objects and

More information

Software Eningeering. Lecture 9 Design Patterns 2

Software Eningeering. Lecture 9 Design Patterns 2 Software Eningeering Lecture 9 Design Patterns 2 Patterns covered Creational Abstract Factory, Builder, Factory Method, Prototype, Singleton Structural Adapter, Bridge, Composite, Decorator, Facade, Flyweight,

More information

Design Patterns Lecture 2

Design Patterns Lecture 2 Design Patterns Lecture 2 Josef Hallberg josef.hallberg@ltu.se 1 Patterns covered Creational Abstract Factory, Builder, Factory Method, Prototype, Singleton Structural Adapter, Bridge, Composite, Decorator,

More information

Object-Oriented Oriented Programming

Object-Oriented Oriented Programming Object-Oriented Oriented Programming Composite Pattern CSIE Department, NTUT Woei-Kae Chen Catalog of Design patterns Creational patterns Abstract Factory, Builder, Factory Method, Prototype, Singleton

More information

The Factory Method Pattern

The Factory Method Pattern The Factory Method Pattern Intent: Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory method lets a class defer instantiation to subclasses. 1 The

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecture 20 GoF Design Patterns Behavioral Department of Computer Engineering Sharif University of Technology 1 GoF Behavioral Patterns Class Class Interpreter: Given a language,

More information

Design Patterns and Frameworks Command

Design Patterns and Frameworks Command Design Patterns and Frameworks Command Oliver Haase Oliver Haase Emfra Command 1/13 Description Classification: Object-based behavioral pattern Purpose: Encapsulate a command as an object. Allows to dynamically

More information

Introduction to Software Engineering: Object Design I Reuse & Patterns

Introduction to Software Engineering: Object Design I Reuse & Patterns Introduction to Software Engineering: Object Design I Reuse & Patterns John T. Bell Department of Computer Science University of Illinois, Chicago Based on materials from Bruegge & DuToit 3e, Chapter 8,

More information

Socket attaches to a Ratchet. 2) Bridge Decouple an abstraction from its implementation so that the two can vary independently.

Socket attaches to a Ratchet. 2) Bridge Decouple an abstraction from its implementation so that the two can vary independently. Gang of Four Software Design Patterns with examples STRUCTURAL 1) Adapter Convert the interface of a class into another interface clients expect. It lets the classes work together that couldn't otherwise

More information

UNIT I Introduction to Design Patterns

UNIT I Introduction to Design Patterns SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road 517583 QUESTION BANK (DESCRIPTIVE) Subject with Code : Design Patterns (16MC842) Year & Sem: III-MCA I-Sem Course : MCA Regulation:

More information

Design patterns. Jef De Smedt Beta VZW

Design patterns. Jef De Smedt Beta VZW Design patterns Jef De Smedt Beta VZW Who Beta VZW www.betavzw.org Association founded in 1993 Computer training for the unemployed Computer training for employees (Cevora/Cefora) 9:00-12:30 13:00-16:00

More information

UNIT I Introduction to Design Patterns

UNIT I Introduction to Design Patterns SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road 517583 QUESTION BANK (DESCRIPTIVE) Subject with Code : Design Patterns(9F00505c) Year & Sem: III-MCA I-Sem Course : MCA Regulation:

More information

Software Design COSC 4353/6353 D R. R A J S I N G H

Software Design COSC 4353/6353 D R. R A J S I N G H Software Design COSC 4353/6353 D R. R A J S I N G H Design Patterns What are design patterns? Why design patterns? Example DP Types Toolkit, Framework, and Design Pattern A toolkit is a library of reusable

More information

Object Oriented Paradigm

Object Oriented Paradigm Object Oriented Paradigm Ming-Hwa Wang, Ph.D. Department of Computer Engineering Santa Clara University Object Oriented Paradigm/Programming (OOP) similar to Lego, which kids build new toys from assembling

More information

Building Graphical User Interfaces. GUI Principles

Building Graphical User Interfaces. GUI Principles Building Graphical User Interfaces 4.1 GUI Principles Components: GUI building blocks Buttons, menus, sliders, etc. Layout: arranging components to form a usable GUI Using layout managers. Events: reacting

More information

DESIGN PATTERN - INTERVIEW QUESTIONS

DESIGN PATTERN - INTERVIEW QUESTIONS DESIGN PATTERN - INTERVIEW QUESTIONS http://www.tutorialspoint.com/design_pattern/design_pattern_interview_questions.htm Copyright tutorialspoint.com Dear readers, these Design Pattern Interview Questions

More information

Design Patterns: Structural and Behavioural

Design Patterns: Structural and Behavioural Design Patterns: Structural and Behavioural 3 April 2009 CMPT166 Dr. Sean Ho Trinity Western University See also: Vince Huston Review last time: creational Design patterns: Reusable templates for designing

More information

Software Quality Management

Software Quality Management 2004-2005 Marco Scotto (Marco.Scotto@unibz.it) Course Outline Creational Patterns Singleton Builder 2 Design pattern space Purpose Creational Structural Behavioral Scope Class Factory Method Adapter Interpreter

More information

Trusted Components. Reuse, Contracts and Patterns. Prof. Dr. Bertrand Meyer Dr. Karine Arnout

Trusted Components. Reuse, Contracts and Patterns. Prof. Dr. Bertrand Meyer Dr. Karine Arnout 1 Last update: 2 November 2004 Trusted Components Reuse, Contracts and Patterns Prof. Dr. Bertrand Meyer Dr. Karine Arnout 2 Lecture 5: Design patterns Agenda for today 3 Overview Benefits of patterns

More information

Building Graphical User Interfaces. Overview

Building Graphical User Interfaces. Overview Building Graphical User Interfaces 4.1 Overview Constructing GUIs Interface components GUI layout Event handling 2 1 GUI Principles Components: GUI building blocks. Buttons, menus, sliders, etc. Layout:

More information

6.3 Patterns. Definition: Design Patterns

6.3 Patterns. Definition: Design Patterns Subject/Topic/Focus: Analysis and Design Patterns Summary: What is a pattern? Why patterns? 6.3 Patterns Creational, structural and behavioral patterns Examples: Abstract Factory, Composite, Chain of Responsibility

More information

Overview. Building Graphical User Interfaces. GUI Principles. AWT and Swing. Constructing GUIs Interface components GUI layout Event handling

Overview. Building Graphical User Interfaces. GUI Principles. AWT and Swing. Constructing GUIs Interface components GUI layout Event handling Overview Building Graphical User Interfaces Constructing GUIs Interface components GUI layout Event handling 4.1 GUI Principles AWT and Swing Components: GUI building blocks. Buttons, menus, sliders, etc.

More information

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich CSCD01 Engineering Large Software Systems Design Patterns Joe Bettridge Winter 2018 With thanks to Anya Tafliovich Design Patterns Design patterns take the problems consistently found in software, and

More information

Design Patterns Reid Holmes

Design Patterns Reid Holmes Material and some slide content from: - Head First Design Patterns Book - GoF Design Patterns Book Design Patterns Reid Holmes GoF design patterns $ %!!!! $ "! # & Pattern vocabulary Shared vocabulary

More information

Brief Note on Design Pattern

Brief Note on Design Pattern Brief Note on Design Pattern - By - Channu Kambalyal channuk@yahoo.com This note is based on the well-known book Design Patterns Elements of Reusable Object-Oriented Software by Erich Gamma et., al.,.

More information

Chapter 13 Lab Advanced GUI Applications Lab Objectives. Introduction. Task #1 Creating a Menu with Submenus

Chapter 13 Lab Advanced GUI Applications Lab Objectives. Introduction. Task #1 Creating a Menu with Submenus Chapter 13 Lab Advanced GUI Applications Lab Objectives Be able to add a menu to the menu bar Be able to use nested menus Be able to add scroll bars, giving the user the option of when they will be seen.

More information

Java: Graphical User Interfaces (GUI)

Java: Graphical User Interfaces (GUI) Chair of Software Engineering Carlo A. Furia, Marco Piccioni, and Bertrand Meyer Java: Graphical User Interfaces (GUI) With material from Christoph Angerer The essence of the Java Graphics API Application

More information

Slide 1. Design Patterns. Prof. Mirco Tribastone, Ph.D

Slide 1. Design Patterns. Prof. Mirco Tribastone, Ph.D Slide 1 Design Patterns Prof. Mirco Tribastone, Ph.D. 22.11.2011 Introduction Slide 2 Basic Idea The same (well-established) schema can be reused as a solution to similar problems. Muster Abstraktion Anwendung

More information

Object-Oriented Oriented Programming Command Pattern. CSIE Department, NTUT Woei-Kae Chen

Object-Oriented Oriented Programming Command Pattern. CSIE Department, NTUT Woei-Kae Chen Object-Oriented Oriented Programming Command Pattern CSIE Department, NTUT Woei-Kae Chen Command: Intent Encapsulate a request as an object thereby letting you parameterize clients with different requests

More information

Design Pattern What is a Design Pattern? Design Pattern Elements. Almas Ansari Page 1

Design Pattern What is a Design Pattern? Design Pattern Elements. Almas Ansari Page 1 What is a Design Pattern? Each pattern Describes a problem which occurs over and over again in our environment,and then describes the core of the problem Novelists, playwrights and other writers rarely

More information

Design Patterns. An introduction

Design Patterns. An introduction Design Patterns An introduction Introduction Designing object-oriented software is hard, and designing reusable object-oriented software is even harder. Your design should be specific to the problem at

More information

TDDB84: Lecture 6. Adapter, Bridge, Observer, Chain of Responsibility, Memento, Command. fredag 4 oktober 13

TDDB84: Lecture 6. Adapter, Bridge, Observer, Chain of Responsibility, Memento, Command. fredag 4 oktober 13 TDDB84: Lecture 6 Adapter, Bridge, Observer, Chain of Responsibility, Memento, Command Creational Abstract Factory Singleton Builder Structural Composite Proxy Bridge Adapter Template method Behavioral

More information

OODP Session 4. Web Page: Visiting Hours: Tuesday 17:00 to 19:00

OODP Session 4.   Web Page:   Visiting Hours: Tuesday 17:00 to 19:00 OODP Session 4 Session times PT group 1 Monday 18:00 21:00 room: Malet 403 PT group 2 Thursday 18:00 21:00 room: Malet 407 FT Tuesday 13:30 17:00 room: Malet 404 Email: oded@dcs.bbk.ac.uk Web Page: http://www.dcs.bbk.ac.uk/~oded

More information

Using Design Patterns in Java Application Development

Using Design Patterns in Java Application Development Using Design Patterns in Java Application Development ExxonMobil Research & Engineering Co. Clinton, New Jersey Michael P. Redlich (908) 730-3416 michael.p.redlich@exxonmobil.com About Myself Degree B.S.

More information

Design Patterns Reid Holmes

Design Patterns Reid Holmes Material and some slide content from: - Head First Design Patterns Book - GoF Design Patterns Book Design Patterns Reid Holmes GoF design patterns $ %!!!! $ "! # & Pattern vocabulary Shared vocabulary

More information

Design patterns for graphical user interface applications

Design patterns for graphical user interface applications Design patterns for graphical user interface applications Prof.Asoc. Alda Kika Department of Informatics Faculty of Natural Sciences University of Tirana Outline Pattern Concept Design pattern in computer

More information

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich CSCD01 Engineering Large Software Systems Design Patterns Joe Bettridge Winter 2018 With thanks to Anya Tafliovich Design Patterns Design patterns take the problems consistently found in software, and

More information

INSTITUTE OF AERONAUTICAL ENGINEERING

INSTITUTE OF AERONAUTICAL ENGINEERING INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad -500 0 COMPUTER SCIENCE AND ENGINEERING TUTORIAL QUESTION BANK Course Name : DESIGN PATTERNS Course Code : A7050 Class : IV B. Tech

More information

Chain of Responsibility

Chain of Responsibility Chain of Responsibility Behavioral Patterns Behavioral Patterns The patterns of communication between objects or classes Behavioral class patterns Behavioral object patterns 2 Intent Avoid coupling the

More information

Design Patterns. Dr. Rania Khairy. Software Engineering and Development Tool

Design Patterns. Dr. Rania Khairy. Software Engineering and Development Tool Design Patterns What are Design Patterns? What are Design Patterns? Why Patterns? Canonical Cataloging Other Design Patterns Books: Freeman, Eric and Elisabeth Freeman with Kathy Sierra and Bert Bates.

More information

Design Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011

Design Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011 Design Patterns Lecture 1 Manuel Mastrofini Systems Engineering and Web Services University of Rome Tor Vergata June 2011 Definition A pattern is a reusable solution to a commonly occurring problem within

More information

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1 Ingegneria del Software Corso di Laurea in Informatica per il Management Design Patterns part 1 Davide Rossi Dipartimento di Informatica Università di Bologna Pattern Each pattern describes a problem which

More information

Window Interfaces Using Swing Objects

Window Interfaces Using Swing Objects Chapter 12 Window Interfaces Using Swing Objects Event-Driven Programming and GUIs Swing Basics and a Simple Demo Program Layout Managers Buttons and Action Listeners Container Classes Text I/O for GUIs

More information

Window Interfaces Using Swing Objects

Window Interfaces Using Swing Objects Chapter 12 Window Interfaces Using Swing Objects Event-Driven Programming and GUIs Swing Basics and a Simple Demo Program Layout Managers Buttons and Action Listeners Container Classes Text I/O for GUIs

More information

Handout 14 Graphical User Interface (GUI) with Swing, Event Handling

Handout 14 Graphical User Interface (GUI) with Swing, Event Handling Handout 12 CS603 Object-Oriented Programming Fall 15 Page 1 of 12 Handout 14 Graphical User Interface (GUI) with Swing, Event Handling The Swing library (javax.swing.*) Contains classes that implement

More information

Design of Software Systems (Ontwerp van SoftwareSystemen) Design Patterns Reference. Roel Wuyts

Design of Software Systems (Ontwerp van SoftwareSystemen) Design Patterns Reference. Roel Wuyts Design of Software Systems (Ontwerp van SoftwareSystemen) Design Patterns Reference 2015-2016 Visitor See lecture on design patterns Design of Software Systems 2 Composite See lecture on design patterns

More information

Creational Design Patterns

Creational Design Patterns Creational Design Patterns Creational Design Patterns Structural Design Patterns Behavioral Design Patterns GoF Design Pattern Categories Purpose Creational Structural Behavioral Scope Class Factory Method

More information

Design Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011

Design Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011 Design Patterns Lecture 2 Manuel Mastrofini Systems Engineering and Web Services University of Rome Tor Vergata June 2011 Structural patterns Part 2 Decorator Intent: It attaches additional responsibilities

More information

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D. Software Design Patterns Jonathan I. Maletic, Ph.D. Department of Computer Science Kent State University J. Maletic 1 Background 1 Search for recurring successful designs emergent designs from practice

More information

Chapter 13 Lab Advanced GUI Applications

Chapter 13 Lab Advanced GUI Applications Gaddis_516907_Java 4/10/07 2:10 PM Page 113 Chapter 13 Lab Advanced GUI Applications Objectives Be able to add a menu to the menu bar Be able to use nested menus Be able to add scroll bars, giving the

More information

Tecniche di Progettazione: Design Patterns

Tecniche di Progettazione: Design Patterns Tecniche di Progettazione: Design Patterns GoF: Builder, Chain Of Responsibility, Flyweight 1 Design patterns, Laura Semini, Università di Pisa, Dipartimento di Informatica. Builder 2 Design patterns,

More information

Implementing GUI context-sensitive help... ECE450 Software Engineering II. Implementing GUI context-sensitive help... Context-sensitive help

Implementing GUI context-sensitive help... ECE450 Software Engineering II. Implementing GUI context-sensitive help... Context-sensitive help Implementing GUI context-sensitive help... ECE450 Software Engineering II Today: Design Patterns VIII Chain of Responsibility, Strategy, State ECE450 - Software Engineering II 1 ECE450 - Software Engineering

More information

Command Pattern. CS356 Object-Oriented Design and Programming November 13, 2014

Command Pattern. CS356 Object-Oriented Design and Programming   November 13, 2014 Command Pattern CS356 Object-Oriented Design and Programming http://cs356.yusun.io November 13, 2014 Yu Sun, Ph.D. http://yusun.io yusun@csupomona.edu Command Encapsulate requests for service from an object

More information

Applying Design Patterns to SCA Implementations

Applying Design Patterns to SCA Implementations Applying Design Patterns to SCA Implementations Adem ZUMBUL (TUBITAK-UEKAE, ademz@uekae.tubitak.gov.tr) Tuna TUGCU (Bogazici University, tugcu@boun.edu.tr) SDR Forum Technical Conference, 26-30 October

More information

Inheritance (cont) Abstract Classes

Inheritance (cont) Abstract Classes Inheritance (cont) Abstract Classes 1 Polymorphism inheritance allows you to define a base class that has fields and methods classes derived from the base class can use the public and protected base class

More information

CSCI 253. Overview. The Elements of a Design Pattern. George Blankenship 1. Object Oriented Design: Iterator Pattern George Blankenship

CSCI 253. Overview. The Elements of a Design Pattern. George Blankenship 1. Object Oriented Design: Iterator Pattern George Blankenship CSCI 253 Object Oriented Design: Iterator Pattern George Blankenship George Blankenship 1 Creational Patterns Singleton Abstract factory Factory Method Prototype Builder Overview Structural Patterns Composite

More information

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University Idioms and Design Patterns Martin Skogevall IDE, Mälardalen University 2005-04-07 Acronyms Object Oriented Analysis and Design (OOAD) Object Oriented Programming (OOD Software Design Patterns (SDP) Gang

More information

Software Reengineering Refactoring To Patterns. Martin Pinzger Delft University of Technology

Software Reengineering Refactoring To Patterns. Martin Pinzger Delft University of Technology Software Reengineering Refactoring To Patterns Martin Pinzger Delft University of Technology Outline Introduction Design Patterns Refactoring to Patterns Conclusions 2 The Reengineering Life-Cycle (1)

More information

Jonathan Aldrich Charlie Garrod

Jonathan Aldrich Charlie Garrod Principles of Software Construction: Objects, Design, and Concurrency (Part 3: Design Case Studies) Introduction to GUIs Jonathan Aldrich Charlie Garrod School of Computer Science 1 Administrivia Homework

More information

Object-oriented Software Design Patterns

Object-oriented Software Design Patterns Object-oriented Software Design Patterns Concepts and Examples Marcelo Vinícius Cysneiros Aragão marcelovca90@inatel.br Topics What are design patterns? Benefits of using design patterns Categories and

More information

Java Swing. Recitation 11/(20,21)/2008. CS 180 Department of Computer Science, Purdue University

Java Swing. Recitation 11/(20,21)/2008. CS 180 Department of Computer Science, Purdue University Java Swing Recitation 11/(20,21)/2008 CS 180 Department of Computer Science, Purdue University Announcements Project 8 is out Milestone due on Dec 3rd, 10:00 pm Final due on Dec 10th, 10:00 pm No classes,

More information

Tuesday, October 4. Announcements

Tuesday, October 4. Announcements Tuesday, October 4 Announcements www.singularsource.net Donate to my short story contest UCI Delta Sigma Pi Accepts business and ICS students See Facebook page for details Slide 2 1 Design Patterns Design

More information

The GoF Design Patterns Reference

The GoF Design Patterns Reference The GoF Design Patterns Reference Version.0 / 0.0.07 / Printed.0.07 Copyright 0-07 wsdesign. All rights reserved. The GoF Design Patterns Reference ii Table of Contents Preface... viii I. Introduction....

More information

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico Modellistica Medica Maria Grazia Pia INFN Genova Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico 2002-2003 Lezione 9 OO modeling Design Patterns Structural Patterns Behavioural Patterns

More information

Java Swing. based on slides by: Walter Milner. Java Swing Walter Milner 2005: Slide 1

Java Swing. based on slides by: Walter Milner. Java Swing Walter Milner 2005: Slide 1 Java Swing based on slides by: Walter Milner Java Swing Walter Milner 2005: Slide 1 What is Swing? A group of 14 packages to do with the UI 451 classes as at 1.4 (!) Part of JFC Java Foundation Classes

More information

Design Patterns. Command. Oliver Haase

Design Patterns. Command. Oliver Haase Design Patterns Command Oliver Haase 1 Description Purpose: Encapsulate a command as an object. Allows to dynamically configure an invoker with a command object. Invoker can invoke command without knowing

More information

An Introduction to Patterns

An Introduction to Patterns An Introduction to Patterns Robert B. France Colorado State University Robert B. France 1 What is a Pattern? - 1 Work on software development patterns stemmed from work on patterns from building architecture

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2006 FINAL EXAMINATION 7pm to 10pm, 19 DECEMBER 2006, Jeffrey Hall 1 st Floor Instructor:

More information

Information systems modelling UML and service description languages

Information systems modelling UML and service description languages Internet Engineering Tomasz Babczyński, Zofia Kruczkiewicz Tomasz Kubik Information systems modelling UML and service description languages Overview of design patterns for supporting information systems

More information

A Reconnaissance on Design Patterns

A Reconnaissance on Design Patterns A Reconnaissance on Design Patterns M.Chaithanya Varma Student of computer science engineering, Sree Vidhyanikethan Engineering college, Tirupati, India ABSTRACT: In past decade, design patterns have been

More information

Topics in Object-Oriented Design Patterns

Topics in Object-Oriented Design Patterns Software design Topics in Object-Oriented Design Patterns Material mainly from the book Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides; slides originally by Spiros Mancoridis;

More information

Keywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator.

Keywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator. Comparative Study In Utilization Of Creational And Structural Design Patterns In Solving Design Problems K.Wseem Abrar M.Tech., Student, Dept. of CSE, Amina Institute of Technology, Shamirpet, Hyderabad

More information

2.1 Design Patterns and Architecture (continued)

2.1 Design Patterns and Architecture (continued) MBSE - 2.1 Design Patterns and Architecture 1 2.1 Design Patterns and Architecture (continued) 1. Introduction 2. Model Construction 2.1 Design Patterns and Architecture 2.2 State Machines 2.3 Timed Automata

More information

Chapter 8. Java continued. CS Hugh Anderson s notes. Page number: 264 ALERT. MCQ test next week. This time. This place.

Chapter 8. Java continued. CS Hugh Anderson s notes. Page number: 264 ALERT. MCQ test next week. This time. This place. Chapter 8 Java continued CS3283 - Hugh Anderson s notes. Page number: 263 ALERT MCQ test next week This time This place Closed book CS3283 - Hugh Anderson s notes. Page number: 264 ALERT Assignment #2

More information

Java continued. Chapter 8 ALERT ALERT. Last week. MCQ test next week. This time. This place. Closed book. Assignment #2 is for groups of 3

Java continued. Chapter 8 ALERT ALERT. Last week. MCQ test next week. This time. This place. Closed book. Assignment #2 is for groups of 3 Chapter 8 Java continued MCQ test next week This time This place Closed book ALERT CS3283 - Hugh Anderson s notes. Page number: 263 CS3283 - Hugh Anderson s notes. Page number: 264 ALERT Last week Assignment

More information

Object Oriented Methods with UML. Introduction to Design Patterns- Lecture 8

Object Oriented Methods with UML. Introduction to Design Patterns- Lecture 8 Object Oriented Methods with UML Introduction to Design Patterns- Lecture 8 Topics(03/05/16) Design Patterns Design Pattern In software engineering, a design pattern is a general repeatable solution to

More information

Design Patterns. SE3A04 Tutorial. Jason Jaskolka

Design Patterns. SE3A04 Tutorial. Jason Jaskolka SE3A04 Tutorial Jason Jaskolka Department of Computing and Software Faculty of Engineering McMaster University Hamilton, Ontario, Canada jaskolj@mcmaster.ca November 18/19, 2014 Jason Jaskolka 1 / 35 1

More information

Functional Design Patterns. Rumours. Agenda. Command. Solution 10/03/10. If you only remember one thing. Let it be this:

Functional Design Patterns. Rumours. Agenda. Command. Solution 10/03/10. If you only remember one thing. Let it be this: If you only remember one thing. Let it be this: Functional Design Patterns Patterns are a useful tool of communication Aino Vonge Corry, PhD Trifork A/S Qcon London 2010 2 Agenda Rumours Rumours Some stuff

More information

Introduction to the JAVA UI classes Advanced HCI IAT351

Introduction to the JAVA UI classes Advanced HCI IAT351 Introduction to the JAVA UI classes Advanced HCI IAT351 Week 3 Lecture 1 17.09.2012 Lyn Bartram lyn@sfu.ca About JFC and Swing JFC Java TM Foundation Classes Encompass a group of features for constructing

More information

Design Patterns. it s about the Observer pattern, the Command pattern, MVC, and some GUI. some more

Design Patterns. it s about the Observer pattern, the Command pattern, MVC, and some GUI. some more Lecture: Software Engineering, Winter Semester 2011/2012 some more Design Patterns it s about the Observer pattern, the Command pattern, MVC, and some GUI Design Pattern *...+ describes a problem which

More information

Window Interfaces Using Swing. Chapter 12

Window Interfaces Using Swing. Chapter 12 Window Interfaces Using Swing 1 Reminders Project 7 due Nov 17 @ 10:30 pm Project 6 grades released: regrades due by next Friday (11-18-2005) at midnight 2 GUIs - Graphical User Interfaces Windowing systems

More information

Is image everything?

Is image everything? Is image everything? Review Computer Graphics technology enables GUIs and computer gaming. GUI's are a fundamental enabling computer technology. Without a GUI there would not be any, or much less: Computer

More information

CSCI Object Oriented Design: Frameworks and Design Patterns George Blankenship. Frameworks and Design George Blankenship 1

CSCI Object Oriented Design: Frameworks and Design Patterns George Blankenship. Frameworks and Design George Blankenship 1 CSCI 6234 Object Oriented Design: Frameworks and Design Patterns George Blankenship Frameworks and Design George Blankenship 1 Background A class is a mechanisms for encapsulation, it embodies a certain

More information

Control Flow: Overview CSE3461. An Example of Sequential Control. Control Flow: Revisited. Control Flow Paradigms: Reacting to the User

Control Flow: Overview CSE3461. An Example of Sequential Control. Control Flow: Revisited. Control Flow Paradigms: Reacting to the User CSE3461 Control Flow Paradigms: Reacting to the User Control Flow: Overview Definition of control flow: The sequence of execution of instructions in a program. Control flow is determined at run time by

More information

2.1 Design Patterns and Architecture (continued)

2.1 Design Patterns and Architecture (continued) MBSE - 2.1 Design Patterns and Architecture 1 2.1 Design Patterns and Architecture (continued) 1. Introduction 2. Model Construction 2.1 Design Patterns and Architecture 2.2 State Machines 2.3 Abstract

More information

Implementing Graphical User Interfaces

Implementing Graphical User Interfaces Chapter 6 Implementing Graphical User Interfaces 6.1 Introduction To see aggregation and inheritance in action, we implement a graphical user interface (GUI for short). This chapter is not about GUIs,

More information

Frames, GUI and events. Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling

Frames, GUI and events. Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling Frames, GUI and events Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling Introduction to Swing The Java AWT (Abstract Window Toolkit)

More information

LECTURE NOTES ON DESIGN PATTERNS MCA III YEAR, V SEMESTER (JNTUA-R09)

LECTURE NOTES ON DESIGN PATTERNS MCA III YEAR, V SEMESTER (JNTUA-R09) LECTURE NOTES ON DESIGN PATTERNS MCA III YEAR, V SEMESTER (JNTUA-R09) Mr. B KRISHNA MURTHI M.TECH, MISTE. Assistant Professor DEPARTMENT OF MASTER OF COMPUTER APPLICATIONS CHADALAWADA RAMANAMMA ENGINEERING

More information

CS 251 Intermediate Programming GUIs: Event Listeners

CS 251 Intermediate Programming GUIs: Event Listeners CS 251 Intermediate Programming GUIs: Event Listeners Brooke Chenoweth University of New Mexico Fall 2017 What is an Event Listener? A small class that implements a particular listener interface. Listener

More information

Tecniche di Progettazione: Design Patterns

Tecniche di Progettazione: Design Patterns Tecniche di Progettazione: Design Patterns GoF: Builder, Chain Of Responsibility, Flyweight 1 Design patterns, Laura Semini, Università di Pisa, Dipartimento di Informatica. Builder 2 Design patterns,

More information

C++ for System Developers with Design Pattern

C++ for System Developers with Design Pattern C++ for System Developers with Design Pattern Introduction: This course introduces the C++ language for use on real time and embedded applications. The first part of the course focuses on the language

More information