Informatics 122 Software Design II

Slides:



Advertisements
Similar presentations
(c) 2009 University of California, Irvine – André van der Hoek1April 20, 2015 – 00:59:05 Informatics 122 Software Design II Lecture 11 André van der Hoek.
Advertisements

+ Informatics 122 Software Design II Lecture 7 Emily Navarro Duplication of course material for any commercial purpose without the explicit written permission.
Informatics 122 Software Design II
(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.
Dept. of Computer Engineering, Amirkabir University of Tech. 1 Design Patterns Dr. Noorhosseini Introduction.
© 2009 University of California, Irvine – André van der Hoek1June 17, 2015 – 09:17:24 Informatics 122 Software Design II Lecture 6 André van der Hoek &
Design Patterns CS is not simply about programming
Design Patterns. What are design patterns? A general reusable solution to a commonly occurring problem. A description or template for how to solve a problem.
© 2010 University of California, Irvine – André van der Hoek1June 26, 2015 – 00:06:40 Informatics 122 Software Design II Lecture 6 André van der Hoek &
DESIGN PATTERNS Redesigning Applications And
(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 Module Name - Object Oriented Modeling By Archana Munnangi S R Kumar Utkarsh Batwal ( ) ( ) ( )
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
(c) 2010 University of California, Irvine – André van der Hoek1July 16, 2015 – 13:45:31 Informatics 122 Software Design II Lecture 8 Nick Lopez Duplication.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns VI Composite, Iterator, and Visitor Patterns.
Vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Idioms and Patterns polymorphism -- inheritance and delegation idioms -- realizing.
Design Patterns.
05 - Patterns Intro.CSC4071 Design Patterns Designing good and reusable OO software is hard. –Mix of specific + general –Impossible to get it right the.
CSSE 374: Introduction to Gang of Four Design Patterns
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Creational Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns IX Interpreter, Mediator, Template Method recap.
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.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
CSE 403 Lecture 14 Design Patterns. Today’s educational objective Understand the basics of design patterns Be able to distinguish them from design approaches.
Design Patterns CS 124 Reference: Gamma et al (“Gang-of-4”), Design Patterns.
ECE450S – Software Engineering II
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
1 Design Patterns Object-Oriented Design. 2 Design Patterns 4Reuse of design knowledge and experience 4Common in many engineering disciplines 4Avoids.
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-1 PS95&96-MEF-L10-1 Dr. M.E. Fayad Creationa.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
Design Patterns. 1 Paradigm4 Concepts 9 Principles23 Patterns.
Design Patterns Introduction
BEHAVIORAL PATTERNS 13-Sep-2012 Presenters Sanjeeb Kumar Nanda & Shankar Gogada.
CS251 – Software Engineering Lectures 18: Intro to DP Slides by Rick Mercer, Christian Ratliff, Oscar Nierstrasz and others 1 و ابتغ فيما آتاك الله الدار.
Design Patterns Introduction “Patterns are discovered, not invented” Richard Helm.
CS 210 Proxy Pattern Nov 16 th, RMI – A quick review A simple, easy to understand tutorial is located here:
Design Patterns Creational Patterns. Abstract the instantiation process Help make the system independent of how its objects are created, composed and.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
Design Patterns: MORE Examples
Design Patterns: Brief Examples
Design Patterns A brief introduction to what they are, why they are useful, and some examples of those that are commonly used.
The Object-Oriented Thought Process Chapter 15
Chapter 10 Design Patterns.
Chapter 5:Design Patterns
Software Design Patterns
MPCS – Advanced java Programming
Introduction to Design Patterns
Design Patterns Lecture part 2.
Introduction to Design Patterns
Design Patterns with C# (and Food!)
object oriented Principles of software design
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2005 Instructor: Patrice Chalin.
How to be a Good Developer
Design Patterns Satya Puvvada Satya Puvvada.
Design Patterns - A few examples
Software Engineering Lecture 7 - Design Patterns
CSE 403 Software Design.
Informatics 122 Software Design II
Informatics 122 Software Design II
DESIGN PATTERNS : Introduction
Informatics 121 Software Design I
Informatics 122 Software Design II
Informatics 122 Software Design II
Informatics 122 Software Design II
Chapter 8, Design Patterns Introduction
Informatics 122 Software Design II
Presentation transcript:

Informatics 122 Software Design II Lecture 5 André van der Hoek Duplication of course material for any commercial purpose without the explicit written permission of the professor is prohibited. November 28, 2018 – 23:29:44 (c) 2006 University of California, Irvine – André van der Hoek

© 2006 University of California, Irvine – André van der Hoek Today’s Lecture Design patterns Assignment 3 November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Fundamental Principles Rigor Separation of concerns modularity abstraction Anticipation of change Generality Incrementality November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

During the Design Process Strive for grouping related functionality (high cohesion) Strive for ungrouping semi-related functionality (high cohesion) Strive for reducing interdependency (low coupling) November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

© 2006 University of California, Irvine – André van der Hoek Class Design Cohesion Completeness Convenience Clarity Consistency November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

© 2006 University of California, Irvine – André van der Hoek Design Patterns “Each 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” [Alexander, Ishikawa, Silverstein 1977] Pattern name problem solution consequences November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Software Design Patterns “Descriptions of communicating objects and classes that are customized to solve a general design problem in a particular context” [Gamma, Helm, Johnson, Vlissides 1995] Pattern name and classification intent also known as motivation applicability structure participants collaborations consequences implementation sample code known uses related patterns November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Patterns Are Designed to Avoid Redesign Creating an object by specifying a class explicitly Dependence on specific operations Dependence on hardware and software platform Dependence on object representations or implementations Algorithmic dependencies Tight coupling Extending functionality by subclassing Inability to alter classes conveniently November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Patterns Apply Two Design Principles Program to an interface, not an implementation interface should be separately defined, using abstract classes Favor object composition over inheritance November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Original Catalogue of Patterns Purpose Creational Structural Behavioral Scope Class Abstract Method Adapter (class) Interpreter Template Method Object Abstract Factory Builder Prototype Singleton Adapter (object) Bridge Composite Decorator Façade Flyweight Proxy Chain of Responsibility Command Iterator Mediator Memento Observer State Strategy Visitor November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Abstract Method (Creational, Class) Provides hooks for subclasses Can connects parallel class hierarchies November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Abstract Factory (Creational, Object) It isolates concrete classes It makes exchanging product families easy. It promotes consistency among products. Supporting new kinds of products is difficult. November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Builder (Creational, Object) It let’s you vary a product’s internal representation. It isolates code for construction and representation. It gives you finer control over the construction process. November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Adaptor (Structural, Object) Let’s a single Adapter work with many Adaptees Makes it harder to override November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Composite (Structural, Object) Defines class hierarchies consisting of primitive objects and composite objects Makes the clients simple Makes it easier to add new kinds of components Can make your design overly general November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Decorator (Structural, Object) More flexible than static inheritance Avoids feature-laden classes high up in the hierarchy A decorator and its component aren’t identical Lots of little objects November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Proxy (Structural, Object) A remote proxy can hide the fact that an object resides in a different address space A virtual proxy can perform optimizations such as creating an object on demand Both protection proxies and smart references allow additional housekeeping tasks when an object is accessed. November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Command (Behavioral, Object) 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 You can assemble commands into a composite command It’s easy to add new Commands, because you don’t have to change existing classes November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Observer (Behavioral, Object) Abstract coupling between subject and observer Support for broadcast communication Unexpected updates November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

State (Behavioral, Object) Localizes state-specific behavior and partitions behaviors for different states It makes state transitions explicit State objects can be shared November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

Visitor (Behavioral, Object) Visitor makes adding new components easy A visitor gathers related operations and separates unrelated ones Adding new ConcreteElement classes is hard Visiting across class hierarchies Accumulating state Breaking encapsulation November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

© 2006 University of California, Irvine – André van der Hoek More… Patterns http://en.wikipedia.org/wiki/Software_pattern http://c2.com/ppr/ Interaction design patterns http://en.wikipedia.org/wiki/Interaction_design_pattern Anti-Patterns http://en.wikipedia.org/wiki/Anti-pattern#Programming_anti-patterns Refactoring http://en.wikipedia.org/wiki/Refactoring And numerous, numerous, numerous books November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek

© 2006 University of California, Irvine – André van der Hoek Assignment 3 Refine the official design of Theseus and the Minotaur (as provided on the course web site) by furnishing any missing classes, methods, and local variables applying design patterns to improve the structure of the design Deliverables a print-out of your final UML design a print-out of your design rationale which critical decisions did you make, and why? Print-outs are to be handed in in class November 28, 2018 – 23:29:44 © 2006 University of California, Irvine – André van der Hoek