Refactoring
version 1.13
Joshua Kerievsky joshua@industriallogic.com Industrial Logic, Inc. http://industriallogic.com
Refactoring To Patterns, Copyright © 2001, Joshua Kerievsky, Industrial Logic, Inc. All Rights Reserved.
Table of Contents
Introduction................................................................................................................................................... 5
Chain Constructors* .......................................................................................................... 6
Motivation .............................................................................................................................................. 7 Mechanics.............................................................................................................................................. 7 Example .................................................................................................................................................. 7
Replace Multiple Constructors with Creation Methods* ..... 9
Motivation.............................................................................................................................................. 9 Mechanics ............................................................................................................................................ 10 Example ................................................................................................................................................ 10 Parameterized Creation Methods.............................................................................................. 13
Encapsulate Subclasses with Creation Methods* ....................... 15
Motivation ............................................................................................................................................ 15 Mechanics............................................................................................................................................ 16 Example ................................................................................................................................................ 16
Extract Creation Class*................................................................................................ 18
Motivation............................................................................................................................................ 18 Mechanics ............................................................................................................................................ 19 Example................................................................................................................................................ 19
Replace Conditional Calculations with Strategy* ....................... 22
Motivation ............................................................................................................................................ 23 Mechanics............................................................................................................................................ 23 Example ................................................................................................................................................ 24
Replace Implicit Tree with Composite* .................................................... 31
Motivation............................................................................................................................................ 31 Mechanics ............................................................................................................................................ 32 Example ................................................................................................................................................ 32
Encapsulate Composite with Builder**...
Regístrate para leer el documento completo.