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

Contents

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

Tom Sapletta
Facebooktwitterredditpinterestlinkedinmail

Author: Tom Sapletta

I connect the expiriences with new ideas. I have been passionate about computers and programming for 10 years. My first (micro) computer was ZX-Spectrum and the programming language was Basic. Since 2010, I have been programming professionally, objectively and functionally in monolithic and micro-service architectures. I am currently creating an ecosystem architecture at API foundation.