My tackle is lighter than yours!

While we’ve all snickered and laughed at the lightweight moniker every project bestows upon itself these days, I’m astounded by how many people take the whole idea very very seriously.

So to protect the innocent, I won’t name any names. Lets just say that I was in a certain irc channel that shall remain nameless, and overhearing a certain individual espousing the benefits of their ‘new’ IoC container.

When asked to list the differentiators of said container, the developer, with deadpan delivery, lists the first two advantages as ‘it’s lightweight’ and ‘it’s simple’.

Somewhat incredulously, we then proceeded to have possibly the funniest conversation I’ve had on irc in quite a while (which is saying something, considering the general hilarity of irc).

It all starts off innocently enough, with a casual inquiry as to what constitutes a lightweight container. The definitions offered (over the course of ten minutes of intense debate) were:

  • It’s simple
  • It’s lightweight because it doesn’t depend on anything ‘heavy’
  • It’s easy
  • It’s IoC
  • It doesn’t use EJB

    The ludicrousness of these definitions is fairly self-evident. What’s truly astounding is that this isn’t your average tss squirt, it’s some guy who has written his own IoC container and (according to him) handles a lot of sick and naked-twister-with-10-jboss-guys type of object creation scenarios. So you’d think that being a developer, he’d be just a tad more coherent that the ill-bred masses out there. No such luck sadly. Javaland is in dire straits indeed when people like this are so breathtakingly un-selfaware.

    So really, I am truly truly curious, what makes a container lightweight? EJB support isn’t it, Spring supports them. Jar size isn’t it either, nor are dependencies. Not coding to a framework isn’t it either (you have to hardcode to a container specific mechanism for any kind of lifecycle management). So what on earth is it?

    ‘Outsidethecontainerness’ isn’t it either, really. All these frameworks are used inside the server, and that’s by far the most popular, common, and expected usage. The only thing that you can get all containers to agree on is not to use EJBs themselves. There’s still a bizarre leap of faith involved in getting from ‘no EJBs’ to ‘lightweight’.

    I mean, even attempting to define a thing by its opposite is equally impossible in this case. Where can I find a heavyweight IoC container?

    What’s the acid test? If some stranger opens his coat and offers to sell me a lightweight container in return for some sexual favours, what can I do to find out if said container is actually lightweight, and that I’m not just handing out valuable sextime for a fraudulent product?

    Granted, there’s somewhat less handwaving by those in the know about low-mass containers than by some other crowds (look at the AOP people, those guys are starting to use extra limbs just to fully express the frantic waving their drug of choice needs), but still, the average squirt on the street is blissfully oblivious of the intricacies of container weight management. Said user is happy to be told on the tin that said product is lightweight, and thus worthy of use. Said user is, incidentally, in dire need of prompt decapitation.

  • 33 Responses to “My tackle is lighter than yours!”

    1. Anonymous Says:

      FIRST

    2. Anonymous Bastard Says:

      Bit of a lightweight bile, isn’t it?

    3. Chakra Yadavalli Says:

      May be light-weight but it sure is funny:

      “What’s the acid test? If some stranger opens his coat and offers to sell me a lightweight container in return for some sexual favours, what can I do to find out if said container is actually lightweight, and that I’m not just handing out valuable sextime for a fraudulent product?”

      Hani, Just make sure that stranger is not IoC+. Most of them have “Acquired Injection Dependency Syndrome” caused by the IoC virus :-)

    4. Eric Biesterfeld Says:

      I always thought that lightweight had to do with how much code and/or XML you had to write to get to hello world, much less a full application.

      By that standard, none of the IoC containers (that I’ve seen) are lightweight. JSPs and Servlets are lightweight.

    5. eu Says:

      Was it Plexus? :-)

    6. New Pope Says:

      If you can eat it without getting overweight, then it’s light for sure.

      Ex: Woman – Lightweight. You can use their container without gaining extra-pounds.

    7. Dan Diephouse Says:

      no it wwasn’t plexus. But plexus will sk00l you.

      Your post is right on Hani.

    8. Mitchell Morris Says:

      Here’s how stupid I am: what problem is IoC trying to solve? Granted, I’m only working on telephone support systems rather than really hard stuff (i.e. systems that sort of wave at but don’t really try that hard at anything like real-time), but I don’t see what IoC does for me. Once I get that, myabe then I’ll see how the “lightweight” adjective makes the “IoC” noun so much more tasty.

    9. tghfbt Says:

      It’s a Spring baby.

    10. Lars Borup Jensen Says:

      “What’s the acid test? If some stranger opens his coat and offers to sell me a lightweight container in return for some sexual favours, what can I do to find out if said container is actually lightweight, and that I’m not just handing out valuable sextime for a fraudulent product?”

      In the light of the above sentence, we should perhaps rename Dependency Injection to Dependency Insertion (AKA Object Insertion) and making sure sure classes to be “inserted” does infact implement some obscure interface (like Banana, D*ldo or alike) … :-) Just a thought…

    11. Berlin Brown Says:

      I have an idea for a lightweight container:

      JSPs/HTML/Javascript/JDBC

      J2SE — ooooooo, haven’t heard that one in a while.

      Socket s = new Socket(host, 1234);

      I came up with this idea first. It is copyrighted to me. Be gone.

    12. Chakra Yadavalli Says:

      Speaking of JSPs… Isn’t “Object Wiring” there in JSP since its inception/conception? Think – ?

    13. Well Hung Says:

      To find out whether it is lightweight or not you need to touch it. Trust me, especially on IRC people very often promise things reality doesn’t match up with. So, only when you hold it in your hands you can feel how heavy it is. Once you have measured the weight and size of it, the quality of time your are looking at is directly proportional to your own preferences (basically boils down to whether size matters to you or not).

      -Well

    14. Berlin Brown Says:

      On another note…

      What IRC channels are we talking about, I hear all these IRC and nobody every mentions which ones.

      Freenode? #spring?

    15. Clown Puncher Says:

      Internet Retards Chatting?

      You know, this reminds me of a story.
      There was once a clown from the esageroup who said:

      “What are Lightweight Frameworks?
      Non-intrusive
      No container requirements
      Simplify Application Development
      Remove re-occurring pattern code
      Productivity friendly
      Unit test friendly
      Very Pluggable
      Usually Open Source”

      I wanted to punch him so hard. What a bunch of crap.
      Productivity Friendly?
      Unit Test Friendly?

      The use of the word “Friendly” to describe something makes me want to go on a rampant clown punching spree.

    16. Java Guru Says:

      ‘Pico’ means small in Italian or Spanish or something, and ‘Spring’ definately suggests the ability to jump which heavy things can’t. Therefore clearly both are lightweight. I would have thought this was obvious.

    17. Anonymous Says:

      Java Guru, you are right. Great arguing! However, if pico means small, then that means it is a small container. Therefore, you can only put small things in it, for example a piece of number 8 wire or a pubic hair. It will in no way ever be big enough for a UML diagram or a XML document.

    18. Anonymous Says:

      I just don’t understand why I need a framework with XML configuration files to replace one liner Java code that calls a factory method or looks up an object from JNDI. I’ve read the Spring examples but my eyes start glazing over as I wonder what the problem is that they’re solving.

      They consistently refer to removing the need for all the “wiring” code. Aren’t you just replacing the simple wiring code with XML files? How is that better?

      Everyone already knows you should use interfaces in public API to pass resources around. Do we really need a framework to create these objects for us?

    19. djs Says:

      To container (and many other) developers, words like “lightweight” and “simple” translate roughly as “I understand my own code”.

    20. Anonymous Says:

      “Aren’t you just replacing the simple wiring code with XML files? How is that better?”

      It is better because it is lightweighter (don’t you get it?).

    21. His Holiness Benedictus XVI Says:

      I’m more lightweight as a Pope than John Paul ever was.

    22. Davide Baroncelli Says:

      Ehr, dear… “24.9.52.44″:

      > They consistently refer to removing the need for
      > all the “wiring” code. Aren’t you just replacing
      > the simple wiring code with XML files? How is that
      > better?

      Well, xml files are one of the possibilities: these days people are evaluating others. I for example have been working on a couple of components that allow context definition in java: I think it may be better in some cases, but it surely is not an absolute winner over spring’s xml config, which is a pretty practical and clean way to structure the “backbone” of the applications: it’s so simple one has very rarely to resort to the doc, it’s consistent over different layers, it’s powerful enough (it’s not just a matter of wiring, a lot of other features are controlled in a very clean way by this mechanism), etc.etc.

      I have yet to see a single comment of someone having tried it for a real application and that has something to complain about: you read the doc once and than find yourself using it pretty naturally. I don’t know if this is lightweight, but if you find it heavy you can just as well avoid using it and staying with traditional factory methods…

    23. Anonymous Says:

      Davide, you need to be more lightweight.

    24. Anonymous Bastard Says:

      Spring Framework is anything but lightweight with its massive 130 packages and 1000+ classes and interfaces.

    25. Sony Mathew Says:

      Check out Context IoC. Thats as light-weight as you can get – no container required.

      Yes, the Java community should define light-weight containers. I have a sense of it – but not sure if its accurate – here goes: If I can construct the “container” and serialize it to another VM and use it – this would be “MY” ideal Light-weight container – I then grade containers from there. I have no limitations on what a container should or can do – IoC is just one feature.

    26. Sony Bono Says:

      Have you not read Fowler’s description of IoC (and thus LTWT containters)?? Actually according to him it’s not IoC it’s DI!!

    27. Breathlessly awaiting next blog Says:

      What’s up Hani? Running ut of things to blog about .. . haven’t seen a new one in a while

    28. The Pope Says:

      If your short on ideas, I suggest you bille Vic. This guy talks on tss as if he was the greatest tech person ever born and advocates using hashmaps for everything. Need to pass some parameters? Stuck them all in a hashmap and call a method like execute(map).

      He also has the wrost writting style ever seen on a forum. He can’t make a sentence with more than 3 words and still be understood and talks as if he didn’t need to backup his claims using his ‘experience’ as argument.

    29. Horn Blower Says:

      You can always blog about your recent nomination to provide bloggin services for Longhorn. Microsoft is looking for a few good bloggers and you’ve been choosen to give the masses your unbiased opinions on the next great operating system!

    30. Clown Puncher Says:

      I officially seconded the nomination, btw.

    31. Anonymous Bastard Says:

      Damnit, Hani! I’m getting severe withdrawal symptoms going cold turkey like this. For the love of God, give us another bile already!

    32. Ben Yu Says:

      I was the said developer. And the said container is:
      http://yan.codehaus.org

      It seems now every container claims to be light-weight. So I’ll just give up that slogan.

      There was some misunderstanding that Hani thought I’m yet another container fan.

      I’m not.

      I was a big suspect about this “ioc container” crap and I’m still conservative about it even after writing one.

      You’ll see I mean what you mean here:
      http://yan.codehaus.org/IOC+Container

      But, talking about differentiator, I’d say:
      1. Zero intrusion. (Which may containers like Pico also claim to be)

      2. No contractural agreement between container and component. It’s not constructor injection, not setter injection, not factory method injection.
      It is all of them and more.
      See:
      http://yan.codehaus.org/Everything+Is+Component

      3. Declarative API and combinatory logic.
      What other container products are missing or are struggling to support can be naturally and easily declared in Yan.
      For example, thinking about using container hierarchy to support local-scope component?
      This simple thing shouldn’t be that complicated at all. It’s no-brainer in Yan.

      And bile me Hani, with all these it does, I still think it is pretty light-weight. ;-)

    33. Christian carter Says:

      the Java community should define light-weight containers. I have a sense of it – but not sure if its accurate – here goes: If I can construct the “container” and serialize it to another VM and use it – this would be “MY” ideal Light-weight container – I then grade containers from there. I have no limitations on what a container should or can do – IoC is just one feature.

    Leave a Reply