Jan 24
The Consultants: Inverting Your Control
Comic, Tech with tags: dependencyinjection, ioc
Add comments
Have any of you gone through some time “cleaning up your code” only to realize that it was actually easier to understand before hand?
January 24th, 2008 at 12:52 pm
Hits a little close to home. IoC is much easier when its the initial design. I’ve been burned on this where *half* of the conversion from monolithic to IoC took place and then I got dragged off before I could finish the rest. The end result was good testing of a bunch of less important things, but code that was very confusing to everyone else.
Proper IoC is lots of interfaces but not many abstract classes. And I don’t autogenerate anything (at build time, runtime is another matter).
Dion — did you draw this or find it?
January 24th, 2008 at 4:01 pm
i get paid a good salary to mess up clean code.
January 24th, 2008 at 10:46 pm
Interfaces? YAGNI !
(See EJB 3.1)
January 25th, 2008 at 12:18 am
IAGNI (I am gonna need it) — Interfaces give me proxies for interception, lazy loading, state management, transaction management, mock testing with EasyMock. They become self documenting, help/force me to break concepts into truly independent concerns, keep my code small and smart. Yep, gonna need all of that and more.
January 25th, 2008 at 5:47 am
Who says refactoring to IoC has to be an all-or-none proposition?
I’ve found that using Spring in legacy code works out pretty well. I don’t have to rewrite the entire code base to benefit from using it. It plays nicely with others.
Anybody who would pay a high priced consultant just to rewrite existing code to make it fashionable deserves to be fleeced.