Design Patterns Introduction to Design Patterns Eriq Muhammad Adams J. Mail : | Blog :

Slides:



Advertisements
Similar presentations
CS490T Advanced Tablet Platform Applications Design Patterns.
Advertisements

ANU COMP2110 Software Design in 2003 Lecture 16Slide 1 Lecture 16: Introduction to design patterns 1What are they? 2Where do they come from? 3Why study.
Design Patterns Examples of smart use of inheritance and polymorphism: Composite Pattern State Pattern FEN 2014UCN Teknologi/act2learn1.
SE2811 Week 7, Class 2 The Gang of Four and more … Lab Thursday: Quiz SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder.
Strategy Pattern1 Design Patterns 1.Strategy Pattern How to design for flexibility?
Design Patterns for Object Oriented systems CSC 515 Ashwin Dandwate.
Design Patterns Yes, they are important Robert Cotton April 23, 2009.
Fundamentals of Software Development 1Slide 1 Gang of Four The beginnings… The original “patterns” idea was from architecture – there are repeatable patterns.
Fall 2007CS 2251 Inheritance and Class Hierarchies Chapter 3.
Design Patterns CS is not simply about programming
James Tam Introduction To Design Patterns You will learn about design techniques that have been successfully applied to different scenarios.
Design Patterns Part I (TIC++V2:C10) Yingcai Xiao 09/10/08.
UML Class Diagram: class Rectangle
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Builder A Creational Design Pattern A Presentation by Alex Bluhm And.
Object-Oriented Design Patterns CSC 335: Object-Oriented Programming and Design.
Design Patterns Trends and Case Study John Hurst June 2005.
Chapter 1: Introduction to Design Patterns. SimUDuck Example.
CSSE 374: Introduction to Gang of Four Design Patterns
Advanced topics in software engineering CSC532 Term Paper Design Patterns Harpreet Singh Submitted By:-
Aniruddha Chakrabarti
Copyright © 2002, Systems and Computer Engineering, Carleton University Patterns.ppt * Object-Oriented Software Development Part 11.
BTS430 Systems Analysis and Design using UML Design Patterns.
January 12, Introduction to Design Patterns Tim Burke References: –Gamma, Erich, et. al. (AKA, The Gang of Four). Design Patterns: Elements of Reusable.
CSC 211 Introduction to Design Patterns. Intro to the course Syllabus About the textbook – Read the introduction and Chapter 1 Good attendance is the.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 27. Review UML dynamic view – State Diagrams.
CS 325: Software Engineering February 12, 2015 Applying Responsibility-Assignment Patterns Design Patterns Situation-Specific Patterns Responsibility-Assignment.
CPSC 372 John D. McGregor Module 4 Session 1 Design Patterns.
L11-12: Design Patterns Definition Iterator (L4: Inheritance)‏ Factory (L4: Inheritance)‏ Strategy (L5: Multiple Inheritance)‏ Composite (L6: Implementation.
Mohammed Al-Dhelaan CSci 253 Object Oriented Design Instructor: Brad Taylor 06/02/2009 Factory Method Pattern.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
1 A Brief Introduction to Design Patterns Based on materials from Doug Schmidt 1.
Design Patterns Singleton & Factory Pattern Eriq Muhammad Adams J. Mail : | Blog :
CS 160: Software Engineering October 22 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CPSC 871 John D. McGregor Module 5 Session 1 Design Patterns.
Enterprise Java v041109Container Managed Relationships1 Container Managed Relationships (CMR) Source: “Enterprise JavaBeans, 3rd Edition”, Richard Monson-Haefel.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
Design Patterns: Elements of Reusable Object- Orientated Software Gamma, Helm, Johnson, Vlissides Presented By: David Williams.
An Introduction To Design Patterns Jean-Paul S. Boodhoo Independent Consultant
Design Patterns. 1 Paradigm4 Concepts 9 Principles23 Patterns.
CS 210 Introduction to Design Patterns August 29, 2006.
The PROXY Design Pattern Oleksandra Sopova Feb, 2014.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Seung Ha.  Façade is generally one side of the exterior of a building, especially the front.  Meaning “frontage” or “face”  In software architecture,
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Builder Pattern. What’s Builder: TO find a solution to the telescoping constructor Problem: Too many parameters Solution: To get an abstract object, a.
CS, AUHenrik Bærbak Christensen1 Compositional Design Principles The “GoF” principles Or Principles of Flexible Design.
CS 210 Introduction to Design Patterns September 14 th, 2006.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
Design Patterns Source: “Design Patterns”, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides And Created.
Design Patterns: MORE Examples
Abstract Factory & Command Pattern
Web Design & Development Lecture 9
MPCS – Advanced java Programming
A Brief Introduction to Design Patterns
Design Patterns Introduction
Design Patterns.
CMPE 135: Object-Oriented Analysis and Design October 24 Class Meeting
Software Engineering Lecture 7 - Design Patterns
Pattern-Oriented Cluster: Comp 630/650/655
Pattern-Oriented Cluster: Comp 630/650/655
Pattern-Oriented Cluster: Comp 630/650/655
CMPE 135 Object-Oriented Analysis and Design March 21 Class Meeting
Introduction to Design Patterns
Design Patterns Imran Rashid CTO at ManiWeber Technologies.
Composite Design Pattern By Aravind Reddy Patlola.
Software Design Lecture : 27.
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
Presentation transcript:

Design Patterns Introduction to Design Patterns Eriq Muhammad Adams J. Mail : | Blog :

 1970s an architect named Christoper Alexander carried out the first know work in the area of patterns.  1987 Kent Back & Ward Cunningham applied architectural pattern ideas for software design and development.  1994 GoF (Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides) introduced 23 patterns. Origin & History

 Design pattern is a documented best practice or core of a solution that has been applied successfully in multiple environments to solve a problem that recurs in a specific set of situations. Definition

Design Patterns vs Frameworks

 Abstraction  Encapsulation  Polymorphism  Inheritance OO Basics

 Identify the aspects of your application that vary and separate them from what stays the same.  Program to an interface, not an implementation.  Favor composition over inheritance (has-a is better than is-a). Design Principles

Basic Patterns

Interface Pattern Common Interface with Different Service Providers as Implementers

Abstract Parent Class Pattern An Abstract Class with Two Concrete Subclasses

public class OrderManager { private int orderID = 0; //Meant to be used internally private int getNextID() { ++orderID; return orderID; } //public method to be used by client objects public void saveOrder(String item, int qty) { int ID = getNextID(); System.out.println("Order ID=" + ID + "; Item=" + item + "; Qty=" + qty + " is saved. "); } Private Methods Pattern

public class Customer { private String firstName; private String lastName; private String address; private boolean active; public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public String getAddress() { return address; } public boolean isActive() { return active; } public void setFirstName(String newValue) { firstName = newValue;} public void setLastName(String newValue) { lastName = newValue; } public void setAddress(String newValue) { address = newValue; } public void isActive(boolean newValue) { active = newValue; } } Accessor Method Pattern

Before Pattern Constant Data Manager Pattern

After Constant Data Manager Pattern (cont.)

Immutable Object Pattern

public class FileLogger { public synchronized void log(String msg) { DataOutputStream dos = null; try { dos = new DataOutputStream( new FileOutputStream("log.txt”,true)); dos.writeBytes(msg); dos.close(); } catch (FileNotFoundException ex) { } catch (IOException ex) { } } Monitor Pattern

GoF Patterns

 O’Reilly – Head First Design Pattern by Eric Freeman & Elisabeth Freeman (2004).  CRC Press – Software Architecture Design Pattern in Java by Partha Kuchana (2004). References