Picocontainer: tagnuts from a thousand monkeys

Recently I’ve had a need for an IoC container to bless some components with some good old fashioned dependency injection lovin’. So I thought that given how many people out there use pico/spring/hivemind, they can’t be THAT bad. Picocontainer in particular seemed very promising, as it seems to take the embeddability aspect of ‘lightweight’ containers to heart, and does not mandate xml files from bizarroworld (Note to all ‘embedded’ library developers, if your lib mandates a logging framework, or a specific xml file, then you don’t know jack about embedding. I hope you’re listening Mr Hivemind).

It also has next to no dependencies, which makes the thought of depending on it (no pun intended) far less of a house of cards that is the usual case with opensores drivel.

Amazingly, even though I really, really wanted to use it, the damn project went out of its way to drive me away. It’s quite impressive really, I go in wanting to use a product, all but committed to it in my mind, and yet, through the magic of a certain unique touch of poo, was driven away and forced to seriously consider other alternatives.

First, given that I know how OSS works, you’re likely to be told to get the CVS version if you ever run into any issue at all. Being an adventurous sort and intimately familiar with cvs, I thought I’d do that from the outset just to save some effort later on. Here’s where the first touch of genius pops up. The cvs modules are called delightful names like ‘java’, ‘php’, and so on. Despite being consummate java developers with many years of experience and loudmouthed opensource prima-donnas, the authors somehow managed, in a fit of mass insanity, to completely forget how cvs module names work. Sure, I can change the name of the directory once I check it out, but really, why force that extra step? How hard can it possibly be to pick non-spastic cvs module names for an open to the public project?

If only that were the only issue. My hopes were further raised by seeing a build.xml there, tempting me with its easygoing ways and no-nonsense approach to life. So I type those magic three letters, and….hrm. Big blowup since I don’t have junit. Rather odd to be defining a junit task for just compiling, but ok, I can live with that….now lets try again…

Ohdear. Having just installed junit, I bet you’d never ever guess what ant tries to do next. Ready? It….downloads junit. After downloading junit, it downloads ant 1.5, THEN downloads ant 1.5 optional. Then, just to be safe, it downloads junit again. Having downloaded that mindboggling set of ‘dependencies’, it then simply blows up and refuses to build anything.

The maven wankstains like to brag of how maven autogenerates build.xml. Come on, has this EVER worked? Having a build.xml there that nobody has even bothered run is incredibly offensive. It’s the sign of an astoundingly lazy mind. A desperate hoister of featureturds with no thought or consideration or indeed…testing! Perhaps this hasn’t been testing because testing ant is just not possible within junit, and therefore is a terrible idea that will result in insta-smiting from the junit gods.

Nevermind, I’ll have to resort to the latest blessed downloads (basically, the last time some random developer got drunk and thought it’d be hilarious to put out a release). In the meantime, I’ll browse the docs and get a better feel for this beast.

The docs are, to put it mildly, the worst documentation I have ever seen for a project in a very long time. This includes projects that have NO documentation, which at least says more than what the pico docs offer.

For one thing, the documentation is all about the religious beliefs of the authors. They proclaim they support setter injection, but expend so much effort telling you off for thinking that way. Every other line links to some antipattern that this group of lackwits has thought up. At some point they even proclaim that soon there will be a ‘componenthaus’ site that offers pico components to download! (har har, how well is that coming along?)

The ‘relative volunteering’ section also seems to somehow totally miss the point of the project. No doubt as a result of another drug laced late night binge, someone chirped up with ‘components! That’s the future! pico is all about enabling component repositories!’ and the other clever clogs in their opium den of filth somehow latched onto this, and thus was born this sad pitiful page.

Of course, all the parts that actually merit documenting have not been. Setter injection requires that you plop in a ComponentAdapter. That section of the documentation is, unsurprisingly, blank. It’s really astounding what people will put up with from open source docs. The pride and acceptance that the community at large takes in these pitiful droppings is akin to a parent proudly displaying the pathetic crayoning of their spastic three year old child to all and sundry. Just image the outcry if a commercial vendor had the gall to put out documentation with a section left completely blank (and leaves it blank for the next year or two).

Similarly, for all the bragging of container hierarchies, the ‘documentation’ offered merely punts you off to the nanowar project, which just talks about itself and you’re forced to infer how that actually relates to component hierarchies and how they might apply in different situations (hint to doc authors, documentation-by-example should come AFTER documentation-by-documentation). That nanowar page also merrily discussed nanocontainer, which is the first we’ve heard of this term (if you, like any sane curious person, were merely reading picocontainer docs). Although there is a particular stroke of genius here, where, in a totally deadpan tone, the inspired author suggests that nanocontainer is best bootstrapped through groovy code in a web.xml parameter.

Of course, the lunacy doesn’t end there. The FAQ goes on to give us more side splitting examples. Witness the helpful question ‘Is a single Uber|Super|BorgCollectivePicoContainer in development? Something that can do all things for all people in all deployment situations?

Honestly, what the hell could the answer to such a question possibly be? You could substitute ANY product for this and still ask the same ridiculous question and still get the same pointless answer-that-has-words-but-says-nothing.

What’s freaky about this project is that the end result does work, and works with some measure of success. Using it though requires turning a very very blind eye to any documentation or non-code emitted by the authors. It’s almost as if the project’s success is through some bizarre cosmic accident. Just another freak output of the thousand monkeys at a thousand keyboards.

21 Responses to “Picocontainer: tagnuts from a thousand monkeys”

  1. Anonymous Says:

    I think they are waiting until they introduce femtocontainer before writing better docs. I understand that attocontainer has a much better build.xml. Of course if you really want quality, go with zeptocontainer. yoctocontainer doesn’t even require downloading. It’s embedded in everyone’s code already. It’s just so small you can’t see it.

  2. skrode Says:

    Mwahahaha….first!!
    On a more sober note, has any Open Source developer really taken note of the doc accusations that Hani biles out so frequently and do I need to say, correctly, these days? Or is it just a shrug and ‘oh well it’s just Hani, my docs rock’ ?

  3. skrode Says:

    ah damn…just as I was previewing, in comes the real first post!!!

  4. it's ok Says:

    I’ve been using Pico for about 8 months now.

    The project itself has always seemed to be in the shambles (crappy docs, incorrect docs, wild api changes between small releases – compounding the bad docs problem)… It was so bad last fall that we decided to depend on only the base pico libs, and none of that nano cruft. We also decided to “insulate” ourselves, by settling on a version and sticking with it – since the point realeases were so volatile.

    Having said all of that, pico is pretty usable. It works quite nicley and is very embedable as advertised. We’re just hoping it “grows up” into something that makes us feel a little less uneasy about our choice.

  5. Jason Carreira Says:

    So Hani, did you end up using it then? The ending left too many questions…

    Mr/Mrs. “it’s ok”, why, given what you just said, would you use said project? Seems like masochism to me.

  6. it's ok Says:

    Although I focused above on all of the “negatives” the fact is that Pico is very easy to learn and use… just grab a working version, and work with it at the API level (ignoring the docs) and you’ll be running with it right away.

    Its features, ease of use, and embedability were exactly what we were after. We have our own config mechanism for other aspects of our app that we wanted to stick with anyway, which was also a bonus because pico doesn’t force a config mechanism upon you (which is, as Hani pointed out, one of the reasons it is easily embedable).

    We’ve just held on to the hope the the turmoil of the pico project would settle down, as the project itself matured… So although it isn’t all-out “masochism”, we definitely thought about the decision quite a bit.

    (is jroller using our feeble minds as a grid computer for solving large mathematical problems that can be reduced into many, many simple ones?)

  7. bradleej Says:

    I jumped into Picocontainer about six months ago for some work I was doing on components for our company. In the end it seemed so limited that I ended up using Spring.

    That was unfortunate because I actually wanted to use Pico as it seemed to be more what I was looking for. I didn’t need all the J2EE stuff in Spring but in the end I could actually read the documents in Spring and figure out how things worked. My perception is that Pico did/does everything I need but simply requires too much head banging to figure out right now.

    Hani’s right on about the goofball documentation on the site. It reads more like a religious diatribe than a discussion of technology. It’s also annoyning self-referential. Click any three links in a row and you’re likely to end up where you started.

  8. Bill Berk Says:

    Pico! You’ll eventually confess to using JBoss (aka EgoContainer)!

  9. Anonymous Says:

    finally a well-reasoned bile. haven’t seen that around these parts in a while.

  10. Anonymous Bastard Says:

    After your seedy love affair with the equally balding Rod Johnson, I’m surprised you’re not biling Spring’s BeanFactory.

  11. Iamlaughingatyouall Says:

    Most opensores ‘software’ are simply junks created by shitheads after a marathon jerkoff session. Do you really expect they bring down the evil at redmond?! shiiiiit…..

  12. Dion Hinchcliffe Says:

    Bah! Everyone knows that Spring will become the Java Ubercontainer (see my link).

    J2EE, EJB 3.0, PicoContainer, HiveMind, etc will all eventually bow before the Spring IoC god.

    Resistance is futile.

    Dion

  13. Jon Says:

    Please bile spring next and it’s incredibly smug creator Rod Johnson.

    ‘I Invented IOC you know, It’s in my book one-on-one EJB reacharound’ – JUST SHUT THE FUCK UP

  14. Anjan Bacchu Says:

    Hi Hani,

    One of the (many) reasons for Pico’s success was that Rickard blogged about it with an (not so good) example. There were lots of comments and more people got to know about it. Since the product just worked and many people don’t read the documentation, they probably liked and blogged about it ?

    BR,
    ~A

  15. Spiffster Says:

    ejb3 spring
    jsr175
    spring ejb3

  16. Jesus Says:

    IoC containers are a bogus concept – completely useless … may be Rod and Gang can make me containers to hold my wee-wee while I piss … and one to wipe my arse after I take a shit …

    Blaaaaaah….get real folks…wake up and smell the crap you are falling for…

  17. Will Sargent Says:

    Nucleus has been doing this since 1998. And didn’t you write your own version in two weeks?

  18. j. p. snodgrass Says:

    Hani,

    You’re a talented writer, and I enjoy your writings and dry, acerbic sense of humour immensely.

    However, I’m curious how you reconcile in your mind the exceedingly high standards to which you hold other ‘open sores’ projects with the festering pile of crap that is OSWorkflow (documentation included).

    p.s. Yes, I speak from experience–far too much experience–with OSWorkflow.

  19. Anonymous Bastard Says:

    “Dry, acerbic sense of humour”

    Shouldn’t that be “Dry, arabic sense of humour”?

  20. Biggus Dickus Says:

    Hey Jesus, how’s the pope getting on up there?

  21. Anonymous Bastard Says:

    “how’s the pope getting on up there?”

    He feels rotten.

Leave a Reply