Introduction to Design Patterns Part 1. © Lethbridge/Laganière 2001 Chapter 6: Using design patterns2 Patterns - Architectural Architectural Patterns:

Slides:



Advertisements
Similar presentations
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Advertisements

1 Layers Data from IBM-Rational and Craig Larman’s text integrated into these slides. These are great references… Slides from these sources have been modified.
Object-Oriented Analysis and Design CHAPTERS 12-14: INTRODUCTION TO DESIGN 1.
© Keith Vander Linden, Dilbert © United Feature Syndicate, Inc.
GRASP Patterns M Taimoor Khan
March R McFadyen1 Architecture Architecture involves the set of significant decisions about the organization of a software system, decisions.
Chapter 6: Using Design Patterns
© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software1 Layers Data from IBM-Rational and Craig Larman…
Introduction to Design Patterns (1). “ In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software.
Data and Process Modeling
Object-Oriented Software Engineering Practical Software Development using UML and Java Design Patterns Sources: Chapter 6: Using Design Patterns, and Chapter.
171 Use Case Descriptions Chapter 4 – Facade Iteration Initial Requirements (Inception Phase)
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
GRASP : Designing Objects with Responsibilities
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Course Instructor: Aisha Azeem
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 16 Slide 1 User interface design.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Object-Oriented Software Engineering Practical Software Development using UML and Java Design Patterns Sources: Chapter 6: Using Design Patterns, and Chapter.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 6: Using Design Patterns Part 1.
Draw a small class diagram (2 or 3 classes) for each of the following examples: For Netflixs, you have to keep track of the movie details AND the copies.
GRASP Principles. How to Design Objects The hard step: moving from analysis to design How to do it? –Design principles (Larman: “patterns”) – an attempt.
Introduction to Design Patterns (1). Definition: “ In software engineering, a design pattern is a general reusable solution to a commonly occurring problem.
BTS430 Systems Analysis and Design using UML Domain Model Part 1—Finding Conceptual Classes.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
1 SAD2 - UML 4 th Lecture Class Diagram in Construction Phase Patterns Case Study Lecturer: Dr Dimitrios Makris
Architecture GRASP Realization of use cases in interaction diagrams Design class diagram Design ( how )
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 6: Using Design Patterns 1.
101 User Interface Patterns and its applications Tonya Groover Department of Computer Science.
Requirements To Design--Iteratively Chapter 12 Applying UML and Patterns Craig Larman.
Design Patterns in Java Chapter 1 Introduction Summary prepared by Kirk Scott 1.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 27. Review UML dynamic view – State Diagrams.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
Object-Oriented Design Principles and Patterns. © 2005, James R. Vallino2 How Do You Design? What principles guide you when you create a design? What.
GRASP: Designing Objects with Responsibilities
DESIGN PATTERNS CSC532 Adv. Topics in Software Engineering Shirin A. Lakhani.
Object-Oriented Software Engineering Practical Software Development using UML and Java Design Patterns – Part 2 Sources: Chapter 6: Using Design Patterns,
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 6: Using Design Patterns.
Patterns COM379 University of Sunderland James Malone.
What to remember from Chap 13 (Logical architecture)
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
CSE 240 Lecture 9. © Lethbridge/Laganière 2001 Chapter 5: Modelling with classes2 Overview Chapter 6 Start on Chapter 7 if time permits.
Design Patterns By Mareck Kortylevitch and Piotreck Ratchinsky.
Design Reuse Earlier we have covered the re-usable Architectural Styles as design patterns for High-Level Design. At mid-level and low-level, design patterns.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 6: Using Design Patterns.
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
CS212: Object Oriented Analysis and Design Lecture 38: Design Pattern-II.
Design Patterns Introduction
1 Chapter 5:Design Patterns. 2 What are design pattern?  Schematic description of design solution to recurring problems in software design and,  Reusable.
Copyright © Craig Larman All Rights Reserved COMP-350 Object-Oriented Analysis and Design GRASP: Designing Objects with Responsibilities Reference:
Basic Concepts and Definitions
Subtopics: 1. Frameworks :Reusable systems 2. Design Patterns 1.
Copyright © Craig Larman All Rights Reserved Large-Scale System Partitioning.
GRASP – Designing Objects with Responsibilities
Design Patterns (Chapter 6 of Text Book – Study just 8)
Chapter 10 Design Patterns.
Chapter 5:Design Patterns
Introduction to Design Patterns
Introduction to Design Patterns
OO Methodology OO Architecture.
Chapter 6: Using Design Patterns
Introduction to Design Patterns Part 1
Layers Data from IBM-Rational and Craig Larman’s text integrated into these slides. These are great references… Slides from these sources have been modified.
Frameworks And Patterns
Patterns.
OBJECT ORIENTED ANALYSIS AND DESIGN
DESIGN PATTERNS : Introduction
Logical Architecture & UML Package Diagrams
Presentation transcript:

Introduction to Design Patterns Part 1

© Lethbridge/Laganière 2001 Chapter 6: Using design patterns2 Patterns - Architectural Architectural Patterns: Related to large-scale and coarse-grained design; Typically applied during the early iterations (the elaboration phase) when the major structures and connections are established. Examples: pipe and filter; MVC; Client-Server; Transaction, Broker, others…

© Lethbridge/Laganière 2001 Chapter 6: Using design patterns3 Patterns – Design Design Patterns: Related to the small and medium-scale design of objects and frameworks. Applicable to designing a solution for connecting the large scale elements defined via architectural patterns Done during detailed design work after architectural design is ‘solid.’ Design patterns are sometimes known as architectural patterns.

© Lethbridge/Laganière 2001 Chapter 6: Using design patterns4 General Concepts of Design Patterns Design Patterns are groups of objects (and their relationships) designed to support a ‘good object design’ What is ‘good object design?’ design that yields high cohesion of our objects, design that has low coupling between our objects, which, among other things, fosters more likely reuse It is one thing to create an object…it is quite another to create the right object for the right situation.

© Lethbridge/Laganière 2001 Chapter 6: Using design patterns5 Object Design – Not a Simple Undertaking! All design involves making decisions, and design is a decision-making activity Good object design involves the assignment of object responsibilities. There are patterns or groupings of objects that work together to accommodate commonly needed activities / functions that subscribe to accepted principles of good design. Deciding what methods belong where and how objects interact (their relationships) is critically important and NOT trivial. All this is really at the heart of what it means to develop an object- oriented system, not merely the drawing of domain model diagrams, package diagrams, etc.

© Lethbridge/Laganière 2001 Chapter 6: Using design patterns6 Preview: What Design Patterns are All About Want to look at more class diagrams – static. But we want to look at recurring groupings of classes that are regularly used to address common problems. Want to take advantage of experiences of others and create a better, more resilient design. Want to use (note the categories of common problems) Patterns that assist us in separating concerns (abstraction- occurrence, observer, player-role); Patterns used to better create class hierarchies of instances; Patterns in which one method simply calls another method in another class (have you seen this??); Patterns where you use delegation to gain access to facilities in one or more other classes (Adaptor, Façade, Proxy patterns); Patterns that help protect other objects from unanticipated access (immutable and read-only interfaces).

© Lethbridge/Laganière 2001 Chapter 6: Using design patterns7 What Design Patterns are All About The recurring aspects of designs are called design patterns.  A pattern is the outline of a reusable solution to a general problem encountered in a particular context Many of them have been systematically documented for all software developers to use A good pattern should —Be as general as possible —Contain a solution that has been proven to effectively solve the problem in the indicated context. Studying patterns is an effective way to learn from the experience of others We will look at several.

© Lethbridge/Laganière 2001 Chapter 6: Using design patterns8 Pattern Description Parameters Context: The general situation in which the pattern applies Problem: —A short sentence or two raising the main difficulty. Forces: The issues or concerns to consider when solving the problem Solution: The recommended way to solve the problem in the given context. —‘to balance the forces’ Antipatterns: (Optional) Solutions that are inferior or do not work in this context. Related patterns: (Optional) Patterns that are similar to this pattern. References: Who developed or inspired the pattern.

© Lethbridge/Laganière 2001 Chapter 6: Using design patterns9 Remember: our patterns define a relation among: a certain context a problem a solution Here again, naming a pattern is using an abstraction of the details of that pattern Patterns represent well-known knowledge Really documents common practice Patterns should be in the public domain Patterns need to be written for the public good. We are looking at certain arrangements of classes and relationships among classes that provide better design and/or more flexibility in addressing common design issues Pattern Context

Pattern Names Patterns have names and the names are ‘suggestive’ of what function they address. Their names can be used in our vocabulary to ‘communicate design intentions.’ The Façade Pattern, can be used to provide the interface from one layer to the next… Singleton Pattern – to ensure global access to a single instance of a class. (a class (really object!) that many processes may desire access to: a monitor?) More Design Patterns: Information Expert (Expert); Adaptor, Creator, Observer, Low Coupling, High Cohesion, Controller; etc. etc. Design Patterns are often organized into different categories too. (Most of these notes from the first two lectures on Design Patterns are taken directly from Larman’s text.) © Lethbridge/Laganière 2001 Chapter 6: Using design patterns10

© Lethbridge/Laganière 2001 Chapter 6: Using design patterns11 Categories of Design Patterns We will study several of the most often used patterns – GRASP Patterns, and Gang of Four (GoF) Patterns Others too. You will note you may be already doing some of these things. You may now see more rationale and more formal reasoning In all cases, the patterns will be most helpful as we strive to design objects and groupings of objects to accommodate common issues.

© Lethbridge/Laganière 2001 Chapter 6: Using design patterns12 We will look at: Gang of Four (GoF) Patterns Grasp Patterns Others. Here are some (not in any particular order): 1. Abstract-Occurrence 2. Singleton(GofF) 3. Observer(GofF) 4. Delegation 5. Adapter(GofF) 6. Façade (GofF) 7.Proxy(GofF) 8.Information Expert (Expert) (Grasp Pattern) 9.Creator (Grasp Pattern) 10.Controller Pattern (Grasp Pattern)