Friday, June 12, 2009 11:20 AM
Sean Feldman
With Power Comes Responsibility
In software like in a real life, not always everything can be extremely simple. One example I can think of right away is Inversion of Control container (IoC). In a simple application, it’s not a big deal, and normally achieved easily. The dependent component leverages some sort of Static Gateway container to resolve the dependencies based on contacts.
1: public class Component
2: {
3: public Component(IDependency dependency) //...
4: public Component() : this(DependencyResolver.Resolve<IDependency>()) //...
5: }
In order to “populate” container with all the dependencies, normally we’d leverage some sort of start-up task to achieve the goal.
1: public class StartupTask : ICommand
2: {
3: public void Execute()
4: {
5: DependencyResolver.Register<IDependency>(() => new Dependency());
6: }
7: }
When does the complexity creeps in? When a real life scenario kicks in. One of those scenarios are services. Why services? Because now it’s no longer a linear execution (a service can be started and stopped), and we neither want to pollute the service code with start-up tasks’ responsibilities. Solution? Different ones, but either way, a bit of complexity is added and from that moment and on developers are required to “ramp up” in knowledge to be able to understand and maintain it (develop or just-keep-alive). This is where “with power comes responsibility” is mostly used.
So is happening in real life. I was quiet surprised to see the most unexpected place – kids playground.
Playgrounds in Israel are mostly for kids up to age of 6 and not extremely attractive for teens. Despite unmatched age, those normally spend some time at playgrounds as well, ruining them completely. A bright idea that a wise man had was to introduce “work-out” machines side-by-side with kids playground, so teens would invest their energy in a more peaceful way. Boy it worked! Not only little kids now have playgrounds in normal and usable condition and their parents a peace of mind, but also the awareness among teenagers for physical fitness has significantly raised. Well done. Here are some shots of proof how with power comes responsibility.

Filed under: Other