Object-Oriented Design Principles and Patterns. © 2005, James R. Vallino2 How Do You Design? What principles guide you when you create a design? What.

Slides:



Advertisements
Similar presentations
GRASP: Designing Objects with Responsibilities
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Design Patterns CMPS Design Patterns Consider previous solutions to problems similar to any new problem ▫ must have some characteristics in common.
Page 1 Building Reliable Component-based Systems Chapter 7 - Role-Based Component Engineering Chapter 7 Role-Based Component Engineering.
Design and Programming Patterns Associated with Java Networking by Margaret Toews cs843, Spring 2003.
Chapter 8, Object Design Introduction to Design Patterns
1 Objectives To introduces the concept of software Design. To introduce the concept of Object- Oriented Design (OOD). To Define various aspects about object.
Low Coupling High Cohesion
Software Engineering I Object-Oriented Design Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
Chapter 8 Object Design Reuse and Patterns. Finding Objects The hardest problems in object-oriented system development are: –Identifying objects –Decomposing.
GRASP : Designing Objects with Responsibilities
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Logical Architecture and UML Package Diagrams
Feb 4, Ron McFadyen1 founded on principles of good OO design idea was first put forth by Christopher Alexander (1977) in their work concerning.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Introduction to software design patterns For CSE 3902 By: Matt Boggus.
Logical Architecture and UML Package Diagrams 徐迎晓 复旦大学软件学院.
Design Patterns.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
GRASP Principles. How to Design Objects The hard step: moving from analysis to design How to do it? –Design principles (Larman: “patterns”) – an attempt.
Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
05 - Patterns Intro.CSC4071 Design Patterns Designing good and reusable OO software is hard. –Mix of specific + general –Impossible to get it right the.
Chapter Five An Introduction to Design Patterns Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Unified Modeling Language, Version 2.0
Architecture GRASP Realization of use cases in interaction diagrams Design class diagram Design ( how )
Requirements To Design--Iteratively Chapter 12 Applying UML and Patterns Craig Larman.
CS 325: Software Engineering February 12, 2015 Applying Responsibility-Assignment Patterns Design Patterns Situation-Specific Patterns Responsibility-Assignment.
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.
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
Y2 eProjects Session 4 – Advanced Topics. Objectives  Dynamic Models  Design Patterns (Optional)  Software testing (for S4) ACCP i7.1\Sem3_4\eProject\T4.
Drexel University CS 451 Software Engineering Winter Yuanfang Cai Room 104, University Crossings
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 05. Review Software design methods Design Paradigms Typical Design Trade-offs.
GRASP: Designing Objects with Responsibilities
Design Patterns Introduction General and reusable solutions to common problems in software design SoftUni Team Software University
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
ECE450S – Software Engineering II
Introduction to Design Patterns Part 1. © Lethbridge/Laganière 2001 Chapter 6: Using design patterns2 Patterns - Architectural Architectural Patterns:
CSC 480 Software Engineering Design With Patterns.
Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-1 PS95&96-MEF-L10-1 Dr. M.E. Fayad Creationa.
Java EE Patterns Dan Bugariu.  What is Java EE ?  What is a Pattern ?
Advanced Object-Oriented Design Patterns and Architectures Part One COEN396A John Xiao
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.
OO Design Roshan Chitrakar. Analysis to Design Do the RIGHT thing Do the RIGHT thing Requirement Analysis Requirement Analysis Domain Modeling with addition.
1 Chapter 5:Design Patterns. 2 What are design pattern?  Schematic description of design solution to recurring problems in software design and,  Reusable.
CS 4240: Rethinking Some OOP Ideas and Terms for OOA&D Readings: Chap. 8 in Shalloway and Trott (referred to as S&T in these slides) Wikipedia on information.
Design. Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems? How do we go about.
CSC 480 Software Engineering Design With Patterns.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
04 - OOD Intro.CSC4071 Software Design ‘Requirements’ defines –The goals the system needs to satisfy. ‘Specification’ defines –The externally-observable.
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
Duke CPS Programming Heuristics l Identify the aspects of your application that vary and separate them from what stays the same ä Take what varies.
Class Relationships Lecture Oo08 Polymorphism. References n Booch, et al, The Unified Modeling Language User Guide, Chapt 10 p.125 n Fowler & Scott, UML.
1 Good Object-Oriented Design Dr. Radu Marinescu Lecture 4 Introduction to Design Patterns.
Basic Characteristics of Object-Oriented Systems
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
Why is Design so Difficult? Analysis: Focuses on the application domain Design: Focuses on the solution domain –The solution domain is changing very rapidly.
Design Engineering 1. Analysis  Design 2 Characteristics of good design 3 The design must implement all of the explicit requirements contained in the.
GRASP – Designing Objects with Responsibilities
Design Patterns: MORE Examples
Chapter 5:Design Patterns
Software Design Patterns
Introduction to Design Patterns
Conception OBJET GRASP Patterns
Introduction to Design Patterns
Instructor: Dr. Hany H. Ammar
CIS 375 Bruce R. Maxim UM-Dearborn
Introduction to Design Patterns Part 1
Chapter 8, Design Patterns Introduction
Presentation transcript:

Object-Oriented Design Principles and Patterns

© 2005, James R. Vallino2 How Do You Design? What principles guide you when you create a design? What considerations are important? When have you done enough design and can begin implementation? Take a piece of paper and write down two principles that guide you - considerations that are important or indicators that you have a good design.

Object-Oriented Design Principles and Patterns © 2005, James R. Vallino3 What Have You Heard About Design? First principles of OOP  Find the nouns  objects/state  Find the verbs  behaviors; methods/functions  Encapsulation, inheritance  Programming Object Interactions  Static  collaboration diagrams  Dynamic  sequence diagrams

Object-Oriented Design Principles and Patterns © 2005, James R. Vallino4 What is the Next Level of Design? How do you decide on the class collaborations?  Simple: Follow principles of design But there are problems here!  What if the principles conflict with each other? –A good class decomposition may have too many connections between classes –Strong encapsulation may lead to performance penalties  Does each new design start from first principles? –Abstraction has been our friend –It can help again  How can we reliably follow the principles? –Learn from previous designers –Stand on each others' shoulders, not each others' toes.

Object-Oriented Design Principles and Patterns © 2005, James R. Vallino5 Key Design Concepts General  Cohesion  Coupling  Information hiding –Encapsulation –Creation  Binding time OO Specific  Behaviors follow data  Class vs. Interface Inheritance –Class = implementation –Interface = type  Inheritance / composition / delegation

Object-Oriented Design Principles and Patterns © 2005, James R. Vallino6 Principles of Successful Design Increase cohesion where possible  Separation of concerns  Focused experts Decrease coupling where possible  Simplify interfaces  Reduce connections in number and volume Employ and support reuse  Reuse existing designs and code where possible  Increase reusability where possible  Design for portability

Object-Oriented Design Principles and Patterns © 2005, James R. Vallino7 Principles of Successful Design – 2 Design for Flexibility  Orthogonal evolution in many dimensions  Anticipate obsolescence Design for testability Use priorities and objectives to decide among alternatives

Object-Oriented Design Principles and Patterns © 2005, James R. Vallino8 Principles of Successful OO Design Prefer type (interface) inheritance over class (implementation) inheritance. Program to the interface, not the implementation. Prefer composition to inheritance:  Deferred binding  Cost: Performance Use delegation to “simulate” runtime inheritance.

Object-Oriented Design Principles and Patterns © 2005, James R. Vallino9 What Are 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. Christopher Alexander A pattern is a general solution to a problem in a context general -- outline of approach only problem -- a recurring issue context -- consider the expected design evolution

Object-Oriented Design Principles and Patterns © 2005, James R. Vallino10 Do You Reinvent the Wheel Each Time? Consider coding idioms! How do you walk through an array in Java? for (i = 0; i < array.length; i++) { // use the array element }

Object-Oriented Design Principles and Patterns © 2005, James R. Vallino11 What Are Design Patterns About? Standard patterns of interactions between classes  Design patterns How to apply them to your application  Deal with subsystems at the higher level of abstraction provided by the patterns What to do when it does not fit exactly  Evaluate options and analyze the trade-offs

Object-Oriented Design Principles and Patterns © 2005, James R. Vallino12 Level for Design Patterns Higher than what you've done before  Not specific data structures  Not algorithmic approaches Lower than whole architectures or frameworks  Not financial systems  Not air-traffic control  Not J2EE Interactions of 3-10 classes in solution domain, i.e., the small subsystem

Object-Oriented Design Principles and Patterns © 2005, James R. Vallino13 Why Patterns? Design for re-use is difficult Experienced designers:  Rarely start from first principles  Apply a working "handbook" of approaches Patterns make this ephemeral knowledge available to all Support evaluation of alternatives at higher level of abstraction

Object-Oriented Design Principles and Patterns © 2005, James R. Vallino14 Design Activity Quick design activity This class  Individually create a design for the stated problem  Collaborate with others, if desired Next class  Submit individual design at start of class  Groups of students create a consensus design  Designs will be presented  Designs will be compared and contrasted