How Pokemon can help You? Destruction in PHP.

How to use destruction power in refactoring without broomstick?

it’s short story about Refactoring from 3D structure to Flat Structure.

big eyes, big problems, can you see?

If you see which Problem are coming with any structure, please say what you are thinking about my 2 steps with Destructing – from structure to flat list.

Example

class PokemonGeodude extends PokemonsFamily {
public function attack()
public function defense()
public function rest()
}

Destructing

fighting, stone, pokemon
Hi, my name is Geodude, Pokemon Geodude…
class PokemonGeodudeAttack()
class PokemonGeodudeDefense()
class PokemonGeodudeRest()

Restructing -> Dependency Injection

class Geodude extends Pokemon
class Attack($pokemon)
class Defense($pokemon)
class Rest($pokemon)
class ***($pokemon)

It is so easy, but tell me please why?

Why so often we have a lot of code which in idea was OK, but in usage not?

In my opinion it’s coming because we are looking for final version of refactoring, but between is existing one or are existing more Bridges which can help change the structure to flat list or/and to another structure.
Maybe are some Pokemons for this Task, maybe You know some magic tricks (methods)?

wither with broomstick

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Author: Tom

I connect the expiriences with new ideas. Embedded System Software & Hardware Developer.

Disqus Comments (0)

tomsapletta

Facebook Comments (0)