Design. Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems? How do we go about.

Slides:



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

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Design Concepts and Principles
1 SOFTWARE DESIGN QUALITY COHESION and COUPLING (Part II)
Chapter 13 Design Concepts and Principles
High Quality Code Why it matters. By Ryan Ruzich.
General OO Concepts and Principles CSE301 University of Sunderland Harry R. Erwin, PhD.
Lecture 9 Improving Software Design CSC301-Winter 2011 – University of Toronto – Department of Computer Science Hesam C. Esfahani
1 CS 426 Senior Projects Chapter 19: Interfaces and Components [Arlow & Neustadt 2005] February 28, 2008.
The Architecture Design Process
Chapter 25 More Design Patterns. Polymorphism Issue: Conditional variation –If-then-else or switch statements –New variation or case: Conditional statements.
Low Coupling High Cohesion
The Software Design Process CPSC 315 – Programming Studio Fall 2009.
Object-Orientated Design Unit 3: Objects and Classes Jin Sa.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Software Issues Derived from Dr. Fawcett’s Slides Phil Pratt-Szeliga Fall 2009.
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Computer Science 240 Principles of Software Design.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Chapter 25 More Design Patterns.
Design II Today: Design Principles…can we define them intro.12.ppt CS 121 “Ordering Chaos” “Mike” Michael A. Erlinger.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
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.
An Introduction to Software Architecture
CSE 303 – Software Design and Architecture
© S. Demeyer, S. Ducasse, O. Nierstrasz Intro.1 1. Introduction Goals Why Reengineering ?  Lehman's Laws  Object-Oriented Legacy Typical Problems  common.
Architecture GRASP Realization of use cases in interaction diagrams Design class diagram Design ( how )
More Design. Next Tuesday First draft of architectural design –use cases –class diagrams for major classes with responsibilities –sequence diagrams for.
SOFTWARE DESIGN Design Concepts Design is a meaningful engineering representation of something that is to be built It can be traced to a customer’s requirements.
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
Patterns and Reuse. Patterns Reuse of Analysis and Design.
CSSE 374: More GRASP’ing for Object Responsibilities
Object-Oriented Design Principles and Patterns. © 2005, James R. Vallino2 How Do You Design? What principles guide you when you create a design? What.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 11 Slide 1 Design.
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 12-5 Software Engineering Design Goals.
GRASP: Designing Objects with Responsibilities
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
Software Design: Principles, Process, and Concepts Getting Started with Design.
1 CMIS301 O-O Thinking Understanding O-O Programming by T Budd.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 11a: Component-Level Design Software Engineering: A Practitioner’s Approach, 6/e Chapter.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Software Design 1.1 CPS 108, Spring 2006 l Object oriented programming and design, we'll use Java and C++  Language independent concepts including design.
Evaluating an Object-Oriented Design ©SoftMoore ConsultingSlide 1.
SEG 4110 – Advanced Software Design and Reengineering Topic T Introduction to Refactoring.
CHAPTER 3 MODELING COMPONENT-LEVEL DESIGN.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
Refactoring Agile Development Project. Lecture roadmap Refactoring Some issues to address when coding.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Week 6: Software Design HNDIT Software Engineering Software Design Learning Outcomes  Understand the activities involved in the Design process.
Chapter 10 Software quality. This chapter discusses n Some important properties we want our system to have, specifically correctness and maintainability.
CHAP-1 OBJECT ORIENTED SYSTEM DESIGN (IT-703)
Design I. Properties of good design Minimize complexity Maintainable Loose coupling Extensibility Reusability High fan in Low to medium fan out Portability.
Design Engineering 1. Analysis  Design 2 Characteristics of good design 3 The design must implement all of the explicit requirements contained in the.
Principles of Programming & Software Engineering
Object Oriented Systems Design
Mantas Radzevičius ifm-2/2
Unit - 3 OBJECT ORIENTED DESIGN PROCESS AND AXIOMS
GRASP – Designing Objects with Responsibilities
Chapter 7: Modifiability
CS240: Advanced Programming Concepts
CMPE 135: Object-Oriented Analysis and Design October 24 Class Meeting
Distribution and components
An Introduction to Software Architecture
Software Design Principles
Chapter 8, Design Patterns Introduction
Information Hidding Dr. Veton Kepuska.
Presentation transcript:

Design

Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems? How do we go about design and what do we produce? LAST TIME

design a la cs121 noun: a predictive model that captures the essential properties of a thing verb: the practice of “creating” a design to solve some problem LAST TIME

Forms of models Text (hyperlinked) Prototypes Mathematical models Diagrams, charts, graphs LAST TIME

Design Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems? How do we go about design and what do we produce? TODAY: Software design

Goals 1.Make it easy to build 2.Make it easy to test 3.Make it easy to maintain 4.Make it easy to change INTUITIVEFLEXIBLE

Desirable Characteristics of a Design Design Grading Minimal Complexity – Brooks would argue that complexity is what you need to manage. Ease of maintenance Loose Coupling – hold connections to different parts of program to a minimum Extensibility – extend without destroying underlying structure Reusability – reuse in other systems High fan-in – high number of classes using this class Low fan-out – each class should use a low to medium number of other classes.

Desirable Characteristics of a Design Design Grading, cont Portability Leanness – designing so there are no extra parts Stratification – try to keep levels of decomposition such that you can view the system at any level and get a constant view Standard Techniques – do not rely on exotic pieces, or approaches

Tic Tac Toe 1.As a team go to a board and do a Domain Model/Top Level Design of Tic Tac Toe 2. From that model, decide on your objects/classes.

Design Principles Heuristics to create design that has the desired characteristics... If we do these, the project will be perfect, and satisfy all the desired Design Characteristics...not really, just has a better chance of success Look at ‘most important’ for our project

Design principle Use real world objects INTUITIVE Domain model Design model Name 8 or less of the most important “real world” objects in your tic tac toe game. Do your design objects match these?

Real-World Objects Start with real-world, build your objects – attributes of that object – operations on that object – operations by that object to other objects – visible object parts – object’s interfaces

Doesn’t look easy, does it?

Design principle Single responsibility principle every class/object should have a single responsibility INTUITIVE (easy to understand) Can you sum up in one simple sentence the responsibility of each of your tic tac toe classes? – Do so...

Single Responsibility Drilled into you via functions in 70 and elsewhere, issue of side effects, etc. Carries over to objects, need more than a single game object which does all things.

Design principle Encapsulate change each class should have at most one reason to change, i.e, should not change because some other class changed FLEXIBLE What changes in your game? What can you envision changing later? A change in one object should not require changes to n other objects

Encapsulation "the process of compartmentalizing the elements of an abstraction that constitute its structure and behavior; encapsulation serves to separate the contractual interface of an abstraction and its implementation.” The purpose is to achieve potential for change: – the internal mechanisms of the component can be improved without impact on other components, – the component can be replaced with a different one that supports the same public interface

Design principle High cohesion Low coupling INTUITIVE FLEXIBLE separates data, operations, and visualization illustrates low coupling and high cohesion

Coupling and Cohesion Coupling is a qualitative measure of the degree to which classes are connected to one another. – 30 public methods is high coupling Cohesion is the “single-mindedness” of a component. Implies that a component or class encapsulates only attributes and operations that are closely related to one another or to the class itself – a focused class, strongly related functionality

Design principle Open-closed principle classes should be open to extension but closed to modification architecture of your game

Open-closed Principle want to create a collection of classes so that we can extend the system adding new functionality, without modifying a large number of existing classes important in Agile, one aspect of refactoring is to mitigate such modification

HELLO WORLD!

Design principle Don’t repeat yourself data/code should occur once and only once

Design principle Law of Demeter only talk to your friends Principle of Least Knowledge

Law of Demeter object A can request a service (call a method) of an object instance B, but object A cannot "reach through" object B to access yet another object, C, to request its services the LoD is a specific case of loose coupling

crapal chapel

myGame->theBoard->cells[0][0].update()

Summary Use real world objects Single responsibility principle Encapsulate change High cohesion/low coupling Open-closed principle Don`t repeat yourself (D.R.Y) Law of demeter (talk only to your friends)