Bad Code smells refactoring Between classes

Fowler et al. Bad smell refactoring between classes

Comienza Ya. Es Gratis
ó regístrate con tu dirección de correo electrónico
Bad Code smells refactoring Between classes por Mind Map: Bad Code smells refactoring Between classes

1. Incomplete Library class Responsabilities must be placed in lib but we don't wana modify

1.1. Introduce foreign Method

1.2. Introduce local extension

2. Message Chains Clients.getA().getB().getC() but object are not related

2.1. Hide delegate

2.1.1. d

2.2. Extract method

2.3. Move method

3. Refused Bequest Sub-class don't need al heritation

3.1. Create a neighbor class

3.1.1. Push down method

3.1.2. Push down field

3.2. If sub class use same behavior but don't wana support interface of super class

3.2.1. Replace inheritance with delegation

3.2.1.1. p

4. Inappropriate Intimacy 2 class having sex too much

4.1. Move method

4.2. Move field

4.3. Extract class

4.4. Hide delegate

4.5. Replace inheritance with delegation

5. Parallele inheritance hiarchy Creating sub class need a lot of subs class of other hiarchy

5.1. Combine hiarchies

5.1.1. Move field

5.1.2. Move method

6. Shotgun Surgey 1 changement require many other changement

6.1. options

6.1.1. Regroupd changement in 1 class

6.1.1.1. Move method

6.1.1.2. Move field

6.1.2. Regroup similar behavior

6.1.2.1. Inline class

6.1.2.1.1. i

7. Alternative classes with different Interfaces Method that doing same shit , but with different signature

7.1. Rename method

7.2. Move method (to the more effective class)

8. Primitive Obsession Primitives values is good BUT => Creating specifique class is better

8.1. Raplace data value with object

8.2. Replace type code with class

8.3. Replace type code with state/strategie

8.4. Replace type code with subclass

8.5. Special cases

8.5.1. if Many var to regroup

8.5.1.1. Extract class

8.5.2. If primitives value are in param list

8.5.2.1. Introduce Parameter object

8.5.3. If presence of tabes

8.5.3.1. Replace array with object

9. Data Class Class with only get/set

9.1. Move method

10. Data Clumps data always found tog

10.1. Extract class

10.2. Introduce parameter object

10.3. Preserve whole object

11. Lazy Class Class doing fuck all & need refactor

11.1. Collapse hiarchy

11.1.1. Faire un merge

11.2. Inline class

11.2.1. Move all its features into another class and delete it.

12. Feature envy Methods is belgar asking too many shit from other class

12.1. Move method

12.2. Extract method

13. Middle man A class delegate too many stuff to another

13.1. Remove middle man

13.2. Special cases

13.2.1. If only few method aren't doing shit

13.2.1.1. Inline method

13.2.1.1.1. Put the method's body into the body of its callers and remove the method.

13.2.2. if Transfom middle class in sub class

13.2.2.1. Replace delegation with inheritance

13.2.2.1.1. Create a field for the superclass, adjust methods to delegate to the superclass, and remove the subclassing.

14. Divergent Change Class is often modified for god knows why

14.1. Extract class

14.1.1. Regrpup resposabilities related (cohesion) or ce qui change en meme temps dans une autre class