Incremental Design Why incremental design? Goal of incremental design Tools for incremental design  UML diagrams  Design principles  Design patterns.

Slides:



Advertisements
Similar presentations
Object Oriented Design Principles Arnon Rotem-Gal-Oz Product Line Architect.
Advertisements

© 2010 Shawn A. Bohner Software Construction and Evolution - CSSE 375 Even more Bad Smells in Code Shawn & Steve Q1 Shawn & Steve Hint 
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
Refactoring Overview  What is refactoring?  What are four good reasons to refactor?  When should you refactor?  What is a bad smell (relative to refactoring.
SOLID Object Oriented Design Craig Berntson
Software Construction and Evolution - CSSE 375 Bad Smells in Code Shawn Bohner & Steve Chenoweth.
Introduction to Refactoring Excerpted from ‘What is Refactoring?’ by William C. Wake and Refactoring: Improving the Design of Existing Code by Martin Fowler.
XP and Refactoring David Talby. Development Methodologies The Software Crisis – 84% of software projects are not on time – 31% of software projects never.
Developed by Reneta Barneva, SUNY Fredonia Component Level Design.
13-Jul-15 Refactoring II. Books Design Patterns is the classic book by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides Basically a catalog.
Agile Design.
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
CLASS DESIGN PRINCIPLES Lecture 2. The quality of the architecture What is a good design? It is the design that at least does not have signs of “bad”.
Company Confidential – Do Not Duplicate 2 Copyright 2008 McLane Advanced Technologies, LLC S.O.L.I.D. Software Development Achieving Object Oriented Principles,
Abstract Factory Design Pattern making abstract things.
OODP Prudent OO Design. OODP-2 The Pillars of the Paradigm Abstraction Encapsulation Hierarchy –Association, Aggregation –Inheritance Polymorphism.
LECTURE 38: REFACTORING CSC 395 – Software Engineering.
Refactoring Improving the structure of existing code Refactoring1.
Introduction to SOLID Principles. Background Dependency Inversion Principle Single Responsibility Principle Open/Closed Principle Liskov Substitution.
Refactoring (continued) Source: "Refactoring: Improving the Design of Existing Code", Martin Fowler.
S.O.L.I.D. Software Development 12 January 2010 (Martin Verboon, Patrick Kalkman, Stan Verdiesen)
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 12-5 Software Engineering Design Goals.
Refactoring1 Improving the structure of existing code.
 What is SOLID  The S in SOLID  The O in SOLID  The L in SOLID  The I in SOLID  The D in SOLID  Questions.
Software Engineering CS3003 Lecture 4 Code bad smells and refactoring.
Refactoring. Refactoring Overview  What is refactoring?  What are four good reasons to refactor?  When should you refactor?  What is a bad smell (relative.
Elements of OO Abstraction Encapsulation Modularity Hierarchy: Inheritance & Aggregation 4 major/essential elements3 minor/helpful elements Typing Concurrency.
Refactoring 2. Admin Blackboard Quiz Acknowledgements Material in this presentation was drawn from Martin Fowler, Refactoring: Improving the Design of.
REFACTORINGREFACTORING. Realities Code evolves substantially during development Requirements changes 1%-4% per month on a project Current methodologies.
Refactoring II Dealing with Polymorphism. Switch in Rental Switches on Movie! class Rental … public double getCharge() { double result = 0; switch (getMovie().getPriceCode()){
Module 3. Smells Between Classes Course: Refactoring.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 11a: Component-Level Design Software Engineering: A Practitioner’s Approach, 6/e Chapter.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 6: Using Design Patterns.
Five design principles
SEG 4110 – Advanced Software Design and Reengineering Topic T Introduction to Refactoring.
CHAPTER 3 MODELING COMPONENT-LEVEL DESIGN.
Refactoring1 Improving the structure of existing code.
Pertemuan 12 Refactoring Mata kuliah: T0144 – Advanced Topics in Software Engineering Tahun: 2010.
Component Design Elaborating the Design Model. Component Design Translation of the architectural design into a detailed (class-based or module- based)
SOLID Design Principles
Session 33 More on SOLID Steve Chenoweth Office: Moench Room F220 Phone: (812) Chandan Rupakheti Office: Moench.
Microsoft Advertising 16:9 Template Light Use the slides below to start the design of your presentation. Additional slides layouts (title slides, tile.
Beginning Software Craftsmanship Brendan Enrick Steve Smith
14 Jul 2005CSE403, Summer'05, Lecture 09 Lecture 09: Fundamental Principles and Best Practices for Software Design Valentin Razmov.
1 Advanced Object- oriented Design – Principles CS320 Fall 2005.
Refactoring (1). Software Evolution Cope with change Feature bloat Design decay Code duplications “Pattern time is refactoring time” Make future changes.
Principles and examples
What is Agile Design? SRP OCP LSP DIP ISP
Course information Old exam Resit Report Result and walkthrough
Strategy Design Pattern
Software Architecture & Difference from Design
CSE687 - Object Oriented Design class notes Survey of the C++ Programming Language Jim Fawcett Spring 2004.
Copyright © by Curt Hill
Code Smells 1.
11/29/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Decorator Pattern Richard Gesick.
Object-Oriented Design
Improving the structure of existing code
Design Tips.
Unit 6 Assignment 2 Chris Boardley.
Questions First On class? On project? On material we’ve discussed?
Refactoring.
A (partial) blueprint for dealing with change
Principles of Object-Oriented Design
Object Oriented Design & Analysis
Some principles for object oriented design
Refactoring.
Chapter 10 – Component-Level Design
Presentation transcript:

Incremental Design Why incremental design? Goal of incremental design Tools for incremental design  UML diagrams  Design principles  Design patterns  Refactoring

Incremental design principles Single responsibility principle  A class should have only one reason to change Persistence mechanisms Open closed principle  Classes should be open for extension and closed for modification Liskov substitution principle  Subtypes must be substitutable for their base types

Incremental design principles Dependency inversion principle  High level modules should not depend on low level modules, instead they should depend on abstractions  Abstractions should not depend on details. Details should depend on abstractions Interface segregation principle  clients should not be forced to depend on methods in interfaces that they do not use.

Design smells Rigidity  A simple functional change requires many changes in many classes Fragility  A single change causes many unrelated parts of the system to break Immobility  Code cannot be reused in other places where similar functionality is required

Design smells Viscosity  Software viscosity When it is easier to write a hack than to stick to the original design  Environment viscosity If build time takes very long, developers do not make changes that take a long time to build Needless complexity  Too much design!

Some design smells and fixes Long methods  break them into smaller methods. Put smaller methods in appropriate classes Duplicate code  Extract code into separate method or a separate method in a separate class Large class  Break into smaller classes with single responsibilities! Large parameter list  Move parameters into a single class, which provides methods to get the parameters

Some design smells and fixes Divergent change  When any change in the system results in change in a single class  Break this class into multiple classes Shotgun surgery  When a single change causes changes in many unrelated classes  Move all the related parts spread across multiple classes into a single class Feature envy  A method in a class is using data and methods of another class!  Move this method to the class that it belongs

Some design smells and fixes Data clumps  Same variables appearing again and again  Group these variables into a single class Switch statements  Can be avoided by inheritance hierarchy