Sorry, I missed this, my apologies. JavaOne week got in my way.
Guice is firmly integrated into the core now, as you saw. All the
extension impls (stuff marked with @Extension) are Guice singleton
components, including "Jenkins", and you'll see @Inject in newer code.
You can also add your own module, too.
OTOH, DI is really only used for objects in the singleton scope, and no
attempts have been made to create other potentially interesting scopes,
such as the "build" scope. This would be probably something useful that
I'd love to see someone run with.
And even if we do all that, I still don't think you can get rid of
Jenkins.getInstance() completely, as there'll be always some objects
that get created outside Guice. I personally think it's a perfectly
normal thing to do, so I don't see the need to prohibit that.
I briefly looked at your code but didn't spot anything that uses
injection. Maybe you've reverted it back. If you have specific questions
I'd be happy to answer.
On 10/06/2014 01:37 AM, Marc Carter wrote:
Not a word from anyone :) ? I'll assume that is "No and so far over the
horizon that you should delete your experimental branch"
Perhaps after three years, the codebase has moved on and it is
reasonable to resurrect the old code branch(es) and implement this
feature? What were the final limiting factors that stopped it going
mainstream at the time?
Marc
On Sunday, 21 September 2014 14:52:43 UTC+1, Marc Carter wrote:
Hi all,
There were plenty of conversations dating from 2011 on this topic
but everything has since gone quiet. I see Guice is included as a
direct dependency of jenkins-core but is hardly mentioned in the
code and JSR-330 annotations don't seem to "just work" in plugin
extensions, descriptors etc. Presumably it is not there for the
benefit of general plugins or I'm just not doing it right
(https://github.com/JoelJ/ez-templates/commit/830001ee4593fa1f395a7c3bb4981e119ac85e13).
Can someone advise please?
Marc
--
You received this message because you are subscribed to the Google
Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
Kohsuke Kawaguchi | CloudBees, Inc. | http://cloudbees.com/
Try Jenkins Enterprise, our professional version of Jenkins
--
You received this message because you are subscribed to the Google Groups "Jenkins
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.