Şabloane de Proiectare Daniel POP, Ph.D. 2 The Plan Introducing fundamental patterns (today) 18 design patterns will be covered based on the case study.

Slides:



Advertisements
Similar presentations
 Recent researches show that predicative programming can be used to specify OO concepts including classes, objects, interfaces, methods, single and multiple.
Advertisements

Design Patterns CMPS Design Patterns Consider previous solutions to problems similar to any new problem ▫ must have some characteristics in common.
Design Patterns Examples of smart use of inheritance and polymorphism: Composite Pattern State Pattern FEN 2014UCN Teknologi/act2learn1.
Object-Oriented Design Patterns Composite Singleton State Observer … Autumn 2012UCN Technology: IT/Computer Science1.
OOP Design Patterns Chapters Design Patterns The main idea behind design patterns is to extract the high level interactions between objects and.
Plab – Tirgul 12 Design Patterns
(c) 2009 University of California, Irvine – André van der Hoek1June 13, 2015 – 21:42:16 Informatics 122 Software Design II Lecture 8 André van der Hoek.
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
Spring 2010CS 2251 Design Patterns. Spring 2010CS 2252 What is a Design Pattern? "a general reusable solution to a commonly occurring problem in software.
(c) 2010 University of California, Irvine – André van der Hoek1June 29, 2015 – 08:55:05 Informatics 122 Software Design II Lecture 8 André van der Hoek.
Design Patterns and Responsibility Assignment CMPT 371 Fall 2004 J.W. Benham.
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Introduction to software design patterns For CSE 3902 By: Matt Boggus.
Introduction To System Analysis and design
Design Patterns Discussion of pages: xi-11 Sections: Preface, Forward, Chapter
Singleton Christopher Chiaverini Software Design & Documentation September 18, 2003.
Design Patterns.
Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Design Dan Fleck CS 421 George Mason University. What is the design phase? Analysis phase describes what the system should do Analysis has provided a.
1 Copyright © 2014 Atego. Patterns INCOSE MBSE WG – Simon A. Perry - Atego.
Design patterns. What is a design pattern? Christopher Alexander: «The pattern describes a problem which again and again occurs in the work, as well as.
Patterns 1 Patterns in OO - history 77 - Work of the architect Christopher Alexander 80s - Kent Beck playing with Smalltalk 91 - Gamma’s PhD thesis on.
05 - Patterns Intro.CSC4071 Design Patterns Designing good and reusable OO software is hard. –Mix of specific + general –Impossible to get it right the.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
January 12, Introduction to Design Patterns Tim Burke References: –Gamma, Erich, et. al. (AKA, The Gang of Four). Design Patterns: Elements of Reusable.
Creational Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
Patterns in programming 1. What are patterns? “A design pattern is a general, reusable solution to a commonly occurring problem in software. A design.
CS 325: Software Engineering February 12, 2015 Applying Responsibility-Assignment Patterns Design Patterns Situation-Specific Patterns Responsibility-Assignment.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style ADVANCED PROGRAM DESIGN WITH C++ Design patterns.
Design Patterns. Patterns “Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution.
Object-Oriented Design Principles and Patterns. © 2005, James R. Vallino2 How Do You Design? What principles guide you when you create a design? What.
D ESIGN P ATTERNS Weslei A. de T. Marinho. T ALK O UTLINE Pattern Definition GRASP Patterns GoF Patterns GoF Patterns Classification Creational Patterns.
18 April 2005CSci 210 Spring Design Patterns 1 CSci 210.
L11-12: Design Patterns Definition Iterator (L4: Inheritance)‏ Factory (L4: Inheritance)‏ Strategy (L5: Multiple Inheritance)‏ Composite (L6: Implementation.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
ECE450S – Software Engineering II
CS 4233 Review Feb February Review2 Outline  Previous Business – My.wpi.edu contains all grades to date for course – Review and contact.
CSC 480 Software Engineering Design With Patterns.
Design Patterns By Mareck Kortylevitch and Piotreck Ratchinsky.
Patterns Roberto Damiani Mendes. Roteiro Definition; Definition; Architecture Patterns; Architecture Patterns; Design Patterns; Design Patterns; GRASP.
Internet and Intranet Protocols and Applications Lecture 5a: HTTP Client-Server Design and Implementation February 15, 2005 Arthur Goldberg Computer Science.
Java EE Patterns Dan Bugariu.  What is Java EE ?  What is a Pattern ?
Model View Controller Architectural Pattern and Observer Pattern
Design Patterns References: Xiaoping Jia, Object-Oriented Software Development Using Java;Douglas C.Schmidt, Design Pattern Case Studies with C++
Design Patterns: Elements of Reusable Object- Orientated Software Gamma, Helm, Johnson, Vlissides Presented By: David Williams.
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
Design Patterns Introduction
MedBiquitous XML Design Patterns Rachel Ellaway 1, Valerie Smothers 2, Joel Farrell 3, Daniel Rehak 1 Northern Ontario School of Medicine, 2 MedBiquitous,
CSC 480 Software Engineering Design With Patterns.
1 Good Object-Oriented Design Dr. Radu Marinescu Lecture 4 Introduction to Design Patterns.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
1 Lecture Material Design Patterns Visitor Client-Server Factory Singleton.
GRASP – Designing Objects with Responsibilities
Design Patterns: MORE Examples
Design Patterns: Brief Examples
The Object-Oriented Thought Process Chapter 15
Behavioral Design Patterns
Software Engineering Lecture 7 - Design Patterns
Frameworks And Patterns
Informatics 122 Software Design II
Patterns.
CSC 480 Software Engineering
Software models - Software Architecture Design Patterns
Introduction to Design Patterns
Informatics 122 Software Design II
CSC 480 Software Engineering
Chapter 8, Design Patterns Introduction
CSC 480 Software Engineering
Presentation transcript:

Şabloane de Proiectare Daniel POP, Ph.D

2 The Plan Introducing fundamental patterns (today) 18 design patterns will be covered based on the case study presented in the text book (next 8 classes): – Design Patterns: Elements of Reusable Object-Oriented Software Remaining patterns (5) will be presented individually (2 classes) Last 3 classes will be devoted to another case study: Designing a Payroll System

3 Definition A pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice. [Christopher Alexander, Sara Ishikawa, Murray Silverstein, Max Jacobson, Ingrid Fiksdahl-King, and Shlomo Angel. A Pattern Language. Oxford University Press, New York, 1977] 4 essential elements: –Pattern name –Problem –Solution –Consequences –Implementation

4 Types of Patterns Architectural Patterns: MVC, Layers etc. Design Patterns: Singleton, Observer etc –We’ll do these ones GUI Design Patterns: Window per task, Disabled irrelevant things, Explorable interface etc Database Patterns: decoupling patterns, resource patterns, cache patterns etc. Concurrency Patterns: Double buffering, Lock object, Producer- consumer, Asynchronous processing etc. Enterprise (J2EE) Patterns: Data Access Object, Transfer Objects etc. GRASP (General Responsibility Assignment Patterns): Low coupling/high cohesion, Controller, Law of Demeter (don’t talk to strangers), Expert, Creator etc. Anti-patterns = bad solutions largely observed: God class, Singletonitis, Basebean etc.

5 Types of Design Patterns Based on the type of the problem it addresses (Purpose) –Fundamental –Creational –Structural –Behavioral Bases on the technique it uses (Scope) –Class: uses inheritance –Object: uses object composition Remark: we’ll cover patterns from the text book, but many other design patterns exist as well; also classification may differ from one author to another.

6 Fundamental Patterns Delegation Delegation = Handing of a task over another object Consequences: –Behavior can be changed at run-time (comparing to inheritance that is static) –The ‘delegate’ is hidden to delegator’s clients –More difficult to implement comparing to inheritance

7 Fundamental Patterns Interface Interface – decouples the service provider from its client Consequences: –Programming to abstraction –Easily change the service provider –Transparency for client

8 Fundamental Patterns Abstract Superclass Abstract superclass – ensures consistent behavior for its subclasses Consequences: –Common behavior is consistent over subclasses –Variant behavior is abstract in superclass –Clients are using the abstract superclass

9 Fundamental Patterns Interface and Abstract Superclass Combines Interface and Abstract Superclass patterns Consequences: –Combines the advantages of both patterns –May provide a default behavior for the entire, or just a subset, of the ServiceIF via AbstractService

10 Fundamental Patterns Immutable Object Immutable object – the internal state of the object doesn’t change after its creation Consequences: –Only constructors can change object’s state –All member functions are const functions (in C++) –Any member function that need to change the state will create a new instance –Increase design’s robustness and maintainability Example: –String class in JDK

11 Fundamental Patterns Marker Interface A class implements a marker interface in order to support a semantic attribute of the system Consequences: –Used by utility classes that need a specific behavior from their elements, without requesting a common base class Example: –Cloneable, Serializable in JDK

12 Bibliography esign-Patterns-Elements- Reusable-Object- Oriented/dp/ /r ef=sr_1_1?ie=UTF8&qid= &sr=8-1 irst-Design-Patterns- Elisabeth- Freeman/dp/ /r ef=sr_1_2?ie=UTF8&qid= &sr=8-2