Design I. Properties of good design Minimize complexity Maintainable Loose coupling Extensibility Reusability High fan in Low to medium fan out Portability.

Slides:



Advertisements
Similar presentations
Software Engineering Key design concepts Design heuristics Design practices.
Advertisements

CS 350 – Software Design The Bridge Pattern – Chapter 10 Most powerful pattern so far. Gang of Four Definition: Decouple an abstraction from its implementation.
© AgiliX Agile Development Consulting Agile Software Architecture Cesario Ramos.
High Quality Code Why it matters. By Ryan Ruzich.
18-1 Verifying Object Behavior and Collaboration Role playing – the act of simulating object behavior and collaboration by acting out an object’s behaviors.
Lecture 9 Improving Software Design CSC301-Winter 2011 – University of Toronto – Department of Computer Science Hesam C. Esfahani
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Design Patterns Today: Intro to Topic designpatterns.f12.ppt CS 121 “Ordering Chaos” “Mike” Michael A. Erlinger.
Software Engineering and Design Principles Chapter 1.
Chapter 25 GRASP: More Objects with Responsibilities 1CS6359 Fall 2011 John Cole.
Week 2 Design Examples and Designing for Change Alex Baker.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
THE OBJECT-ORIENTED DESIGN WORKFLOW Interfaces & Subsystems.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
NJIT More GRASP Patterns Chapter 22 Applying UML and Patterns Craig Larman Prepared By: Krishnendu Banerjee.
The Software Design Process CPSC 315 – Programming Studio Fall 2009.
1 CS 691z / 791z Topics on Software Engineering Chapter 17: Interfaces and Subsystems [Arlow & Neustadt, 2002] March 6, 2007.
Data Abstraction: The Walls
Computer Science 240 Principles of Software Design.
BY VEDASHREE GOVINDA GOWDA
The Design Discipline.
Building SOLID Software with Dependency Injection Jeremy Rosenberg.
CSE 303 – Software Design and Architecture
Computer Science 240 © Ken Rodham 2006 Principles of Software Design.
Systems Analysis and Design in a Changing World, 6th Edition 1 INTRODUCTION TO SYSTEMS ANALYSIS AND DESIGN: AN AGILE, ITERATIVE APPROACH Chapter 11 SATZINGER.
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
THE SOFTWARE DESIGN PROCESS CSCE 315 – Programming Studio Spring 2010.
S.O.L.I.D. Software Development 12 January 2010 (Martin Verboon, Patrick Kalkman, Stan Verdiesen)
Design Concepts and Principles Instructor: Dr. Jerry Gao.
CSC172 Class Design Pepper. Goals How to design classes How to think in terms of objects StarUML Code Generation.
18 April 2005CSci 210 Spring Design Patterns 1 CSci 210.
Design Patterns. Properties of good design Minimize complexity Maintainable Loose coupling Extensibility Reusability High fan in Low to medium fan out.
Design Patterns Façade, Singleton, and Factory Methods Team Good Vibrations (1)
Refactoring for Testability (or how I learned to stop worrying and love failing tests) Presented by Aaron Evans.
Software Design Principles
Incremental Design Why incremental design? Goal of incremental design Tools for incremental design  UML diagrams  Design principles  Design patterns.
1 Venkat Subramaniam Quality of Software Design Good design is critical to a software application A good design has following characteristics –Specific.
Lecture 18: Object-Oriented Design
12 OBJECT-ORIENTED DESIGN CHAPTER
Five design principles
12/24/2015B.Ramamurthy1 Analysis and Design with UML: Discovering Classes Bina Ramamurthy.
Design. Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems? How do we go about.
Component Design Elaborating the Design Model. Component Design Translation of the architectural design into a detailed (class-based or module- based)
Lecture Model View Controller s/w architecture AND general tips on structuring classes.
SOLID Design Principles
Principled N-Tier Design or, a Solution to the Solution Problem Steve | ardalis.com Telerik, Inc.
Beginning Software Craftsmanship Brendan Enrick Steve Smith
1 Chapter 13: Class Diagram Chapter 19 in Applying UML and Patterns Book.
Chapter 1: Software design
Object-Orientated Analysis, Design and Programming
Unit - 3 OBJECT ORIENTED DESIGN PROCESS AND AXIOMS
Design Patterns: MORE Examples
Mediator Design Pattern
Software Architecture & Difference from Design
Copyright © by Curt Hill
object oriented Principles of software design
The Object Oriented Approach to Design
The Software Design Process
Design Tips.
Analysis models and design models
An Introduction to Software Architecture
Producing Production Quality Software
Algorithms and Problem Solving
Software Design Principles
4: Object-oriented Analysis & Design
Designing for Volatility
A (partial) blueprint for dealing with change
Object/Class Design.
Dependency Inversion principle
Presentation transcript:

Design I

Properties of good design Minimize complexity Maintainable Loose coupling Extensibility Reusability High fan in Low to medium fan out Portability Leanness Stratification Standard techniques

Some principles of good design Open-Close Principle Dependency Inversion Principle Interface Segregation Principle Single Responsibility Principle Liskov’s Substitution Principle

Design heuristics 1.Use real-world and synthetic objects a)identify objects & their attributes b)determine relationships c)how they interact to realize use cases 2.Refine your classes based on responsibilities 1.don’t let an class do too much 2.keep it cohesive 3.identify areas of potential change

Example I am developing software that (among other things) displays geometric primitives Initially I only need to support lines In the future I may need to add spheres, triangles, and squares Rather than reinvent the wheel, I am going to use an existing program. Actually, I really want the option of choosing at run time between two different drawing programs, one that is better at low resolutions and one that is better at high resolutions

current design shape line draw()

Drawing APIs Package 1: drawLine(x1, y1, x2, y2) Package 2: drawALine(x1, x2, y1, y2)

solution 1 line.draw() { if (resolution == high) drawLine(v1.x, v1.y, v2.x, v2.y) else drawALine(v1.x, v2.x, v1.y, v2.y) }

solution 1 AdvantagesDisadvantages

solution 1 Advantages –simple to implement –simple to understand Disadvantages –is knowing about resolution really a responsibility of shape? –we are duplicating code

Some principles of good design Open-Close Principle Dependency Inversion Principle Interface Segregation Principle Single Responsibility Principle Liskov’s Substitution Principle No forgery principle (keep data in a single place) One rule one place (don’t duplicate code)

solution 2 line lineDP1lineDP2

solution 2 Advantages –simple to implement –simple to understand Disadvantages –as additional shapes and drawing programs are added the number of classes becomes LARGE

Shape TriangleLine Drawer Low ResHi Res Bridge design pattern defines the interface shapes use to draw “adapters” for specific drawing interfaces

Bridge Problem: Want to support multiple implementation that have different interfaces in an extensible way.

Last time Choose a game loop at some specific part of your (core) game Develop a domain model –what are the things (nouns) –what are their relationships Develop your game loop use case Use CRC cards to come up with a first pass at your design Act out the game loop use case

This time Critique your design –based on design principles –properties of good design –design heuristics Report to class