test.ical.ly | getting the web by the balls

Jan/11

18

When embracing Separation of Concerns code reorganisation can be a bliss!

The design pattern that should be most repeatedly talked about should be Separation of Concerns (that’s why I’m doing that all the time).

Recently working on ImageTransform I decided to do a big refactoring during which I had to move around a lot of classes as I reorganised the folder structure. This of course includes changing a lot of namespaces.

Usually something like this would drag a lot of work behind. Unless..

Unless you cared for your classes to be decoupled.

Take a look at this commit.

You can see that a lot of classes moved namespaces and of course there is a lot of code touched to acknowledge this.

However this wasn’t much work. Mostly done by automatic substitution.

Even most of my PHPUnit tests still passed during the process!

All together the refactoring (of a few more commits than just the one) took about one hour in total.

Currently  there is a discussion on the Symfony mailing list that will probably result in a similar refactoring only on a much bigger scale. Still I think that it will not take significantly longer. ;)

· · · · · ·



<<

>>

Theme Design by devolux.nh2.me