Dependencies can seriously disturb sleep

November 21, 2008

Code reuse has ever been one of the most famous principles in programming.

When I started learning Pascal, my teacher always repeated I had to write my code thinking about the future. Right now, when I model a new library, I think at the best way to give it the longest life I can. I try to imagine how many times I’ll need this library, how many environments I’ll put it inside, how many “younger” code would be able to trust on it.

Now, which is the best way to ensure long life to your code? I honestly don’t know anything better than reduce dependencies.

Most of modern frameworks encourage developers to use an incredibly huge lot of third party software. They provide you everything you need (and often everything you don’t). But typically they enforce your code to be somewhat “broken”, not self-consistent. “Modern” applications heavily based on “modern” frameworks tend to be nothing more than a simple collection of separated and complicated classes. The flow itself of the entire application is often delegated to the framework, so that you can really understand the code only if you take a deep look at the configuration files.

Ok, maybe such kind of code is more reliable, scalable, trustable but… what about his life? What about your mission critical software based upon (just a random one) Spring, if a day Spring desappears? What if a day a new big framework rise on the market? What if a whole new paradigm invades the programming languages?

The only solution I see is always the same: protect your code. Put your business code into self-consistent libraries, limit external dependencies as much as you can. What does not mean do not use external libraries at all. On the contrary, make an intelligent use of them, and whenever is possible use the Facade pattern to reduce dependencies on it. It is always good to have an open door when you find a better library.

And overall, write the important flow of your business code by yourself, make it able to run by itself and sleep a bit more quiet. :)

Entry Filed under: ammentos, ddpole, development, enhanced reality, java, mission, opensource. .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Mission plan

November 2008
M T W T F S S
« Oct   Dec »
 12
3456789
10111213141516
17181920212223
24252627282930

Recent Posts

Top Clicks

RSS News from JUG Sardegna

Links

Blogroll