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.
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
Contents
class PokemonGeodude extends PokemonsFamily { public function attack() public function defense() public function rest() }
Destructing
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)?