users@glassfish.java.net

Re: Can hk2:run be used to run anything meaningful?

From: Richard S. Hall <heavy_at_ungoverned.org>
Date: Sat, 17 Jan 2009 12:22:33 -0500

glassfish_at_javadesktop.org wrote:
> I'm glad you asked, Richard, because now that I review my remark, I realize that it could be misleading -- especially in a context in which many people make choices "because it said so on the Internet".
>
> I think the key elements in understanding my remark are "to me" and "looks" (i.e. now). Here are the reasons for which at this time I would rather use HK2 than iPOJO for dependency injection -- if I end up using DI at all.
>

No problem. I wasn't offended, just wanting to learn possible improvements.

> 1. As far as I can tell, all our team's current needs are completely covered by OSGi's BundleContext and ServiceTracker. It takes a very simple and intuitive pair of annotations like HK2's @Inject and @Extract to convince us to use DI at all.
>

I assume these are similar to iPOJO's @Require and @Provide...

> 2. While iPOJO clearly offers much more power than HK2 in terms of dependency injection, this extra power doesn't necessarily translate into more chances of success for a team that uses the framework. In fact, it can be like buying your kid a BMW M3: if you love your kid, you give him/her a 328 instead, and wait until (s)he's mature enough to keep an M3 on the road. Which is -- to return to our Java context -- until (s)he fully understands that a single try-catch-finally is not enough for safely releasing more than one resource, and that "synchronized" stands for more than mutual exclusion.
>
> 3. I don't think a high percentage of the Java-speaking population could debug whistling an imperfect piece of code that uses @Temporal(timeout=5000). I for one would probably loose my smile at some point... :-)
>

So, I guess what you are saying is that you'd rather use a framework
that has fewer capabilities to avoid people actually using advanced
capabilities. Is that correct?

I guess I can understand the desire to keep things simple, but I assume
HK2 will continue to add more advanced capabilities, like all
frameworks. Keeping things simple is a goal for everyone, even iPOJO.
However, sometimes we run into things that are not simple, so it is nice
to have the ability to address them when the time comes.

Clearly, not one framework solves every issue (to everyone's liking), so
there is room for more than one. I am just glad to know there apparently
wasn't some significant flaw with iPOJO that kept you from using it
(other than maybe our documentation :-)).

-> richard

p.s. Don't let @Temporal(timeout=5000) scare you, it is just an optional
service dependency that may wait a little while if the service is not
available. :-)


> [Message sent by forum member 'andreijuan' (andreijuan)]
>
> http://forums.java.net/jive/thread.jspa?messageID=326595
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>