Refactoring Strategies

Slides:



Advertisements
Similar presentations
Engr 691 Special Topics in Engineering Science Software Architecture Spring Semester 2004 Lecture Notes.
Advertisements

OO Programming in Java Objectives for today: Constructors Method Overriding & Overloading Encapsulation.
Test practice Multiplication. Multiplication 9x2.
Module 7. Simplifying Conditional Expressions Course: Refactoring.
Clean code. Motivation Total cost = the cost of developing + maintenance cost Maintenance cost = cost of understanding + cost of changes + cost of testing.
You want me to do what??? Refactoring legacy applications aka : fixing someone else’s “bad” code Niel Zeeman Team Foundation Consulting
Software Testing and Maintenance 1 Today’s Agenda  Course Evaluation  HW 4 Return  HW 5 Correction  Quiz 4 Next Class  Software Refactoring.
COP 3331 Object Oriented Analysis and Design Chapter 7 – Design by Abastraction Jean Muhammad.
Multiplication How can decomposing factor assist me when solving multiplication problems?
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Prototype Design Pattern A Creational design pattern.
George Blank University Lecturer. REFACTORING Improving the Design of Existing Code Supplement to Ian Sommerville, Software Engineering, Chapter 20 Prepared.
Different Types of Fields to Describe the Earth. Anisotropy, heterogeneity SEM of shale (Josh et al., 2012)
CSC 211 Introduction to Design Patterns. Intro to the course Syllabus About the textbook – Read the introduction and Chapter 1 Good attendance is the.
Refactoring. Mathematics: Factor ● fac·tor – One of two or more quantities that divides a given quantity without a remainder, e.g., 2 and 3 are factors.
Objectives: Write equations that represent real-world situations. Solve 2-step equations. Standards Addressed: C: Create and interpret equations.
Objectives: Graph the solution sets of compound inequalities. Solve compound inequalities. Standards Addressed: C: Create and interpret inequalities.
1 Software Maintenance and Evolution CSSE 575: Session 3, Part 1 Simplifying Conditionals Steve Chenoweth Office Phone: (812) Cell: (937)
Title of Presentation Name Date 2011 Presentation Template.
Refactoring Deciding what to make a superclass or interface is difficult. Some of these refactorings are helpful. Some research items include Inheritance.
Objective: Write and solve multistep equations. Standards Addressed: C: Create and interpret equations that model problem situations E: Select.
1 CSC/ECE 517 Fall 2010 Lec. 3 Overview of Eclipse Lectures Lecture 2 “Lecture 0” Lecture 3 1.Overview 2.Installing and Running 3.Building and Running.
Refactoring. Refactoring Overview  What is refactoring?  What are four good reasons to refactor?  When should you refactor?  What is a bad smell (relative.
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.
Lists of Structures CS 5010 Program Design Paradigms “Bootcamp” Lesson TexPoint fonts used in EMF. Read the TexPoint manual before you delete this.
NJIT 1 Test Driven Development and Refactoring Larman, Chapter 21.
Objectives: State and use symbols of inequality. Solve inequalities that involve addition and subtraction. Standards Addressed: C: Create and interpret.
Refactoring Conditionals Lesson Five: Conditionals.
Class Relationships A class defines a type of data Composition allows an object of another class to define an attribute of a class –Employee “has a”
1 Software Maintenance and Evolution CSSE 575: Session 3, Part 3 Dealing with Generalization Steve Chenoweth Office Phone: (812) Cell: (937)
Introduction. A function in a word processor Integrates the structured data source to a document template Produces multiple documents such as letters,
Refactoring Advanced Software Engineering Dr Nuha El-Khalili.
Low Level Coded Product Structure Tree
Refactoring. Mathematics: Factor ● fac·tor – One of two or more quantities that divides a given quantity without a remainder, e.g., 2 and 3 are factors.
Refactoring. 2 Process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its internal.
Electrostatics is the study of electric studies of currents and fields.
Types of Inheritance in C++. In C++ we have 5 different types of inheritance: – Single Inheritance – Multiple Inheritance – Hierarchical Inheritance –
Software Construction and Evolution - CSSE 375 Simplifying Conditionals Shawn & Steve.
CSSE 375 Organizing Data – Part 1 Shawn and Steve Q1.
Software Construction and Evolution - CSSE 375 Dealing with Generalization Steve and Shawn Left – In the 1990 movie “The Freshman,” Matthew Broderick,
Example 31: Solve the following game by equal gains method: Y I II I II I X II II
Module 9. Dealing with Generalization Course: Refactoring.
Catalog of Refactoring (5) Simplifying Conditional Expressions.
Combined Strategy MarketingMarketing How can we develop an effective marketing plan? ProductionProduction What else we can do with the current production.
Code Refactoring Milan Vukoje Soprex SkfOffice2 SkfOffice3 Big5 Quality oriented We are hiring…
TEMPLATE METHOD DESIGN PATTERN -SWAPNIL SHAH. WHAT IS A DESIGN PATTERN… A design pattern is a general reusable solution to a commonly occurring problem.
Defining Success Define the relationship between quantities with emphasis on the rate of change and initial value Communicate precisely the meaning of.
MKT 421 Week 4 DQ 2 What are the similarities and differences between promotional push strategies and promotional pull strategies? What is an example of.
Catalog of Refactoring
Module Road Map Refactoring Why Refactoring? Examples
You have described a real world situation using words or symbols
Focus on Expressions and Equations
Refactoring Methods: Kevin Murphy.
Solve more difficult number problems mentally
Extract Subclass, Extract Superclass and Extract Hierarchy
BACK SOLUTION:
How to transfer inventory items in quickbooks In the Transfer Inventory dialog box, enter details such as, the transfer date, item code, quantity transferred,
Systems of Inequalities
Physics 111 Practice Problem Solutions 01 Units, Measurement, Vectors SJ 8th Ed.: Ch , 3.1 – 3.4 Contents: 1-7, 1-9, 1-10, 1-12, 1-15, 1-21* 3-5,
Code Smells 1.
Learn about the multiples of fractions
Advanced Java Programming
Refactoring Types Blake Duncan.
Subtitle Presenter Date
What connections can you make? What else do you notice?
Develop Effective Products & Services
Thing / Person:____________________ Dates:_________________
Similarities Differences
Refactoring.
Presentation transcript:

Refactoring Strategies Josh Schenk

Types Form Template Method Decompose Conditional Push Down Field

Form Template Method Situation: When two subclasses contain similar functionality Solution: Merge the functionality into the superclass

Decompose Conditional Situation: Conditional clauses are bulky and difficult to interpret Solution: Decompose the functionality into multiple components

if (date. before (SUMMER_START) || date if (date.before (SUMMER_START) || date.after(SUMMER_END))     charge = quantity * _winterRate + _winterServiceCharge; else charge = quantity * _summerRate; if (notSummer(date))     charge = winterCharge(quantity);  else charge = summerCharge (quantity);

Push Down Field Situation: Field in superclass is only used by some subclasses Solution: Move field to those subclasses