Return-Path: Delivered-To: apmail-struts-dev-archive@www.apache.org Received: (qmail 12495 invoked from network); 26 Feb 2007 17:16:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Feb 2007 17:16:41 -0000 Received: (qmail 25636 invoked by uid 500); 26 Feb 2007 17:16:47 -0000 Delivered-To: apmail-struts-dev-archive@struts.apache.org Received: (qmail 25608 invoked by uid 500); 26 Feb 2007 17:16:47 -0000 Mailing-List: contact dev-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list dev@struts.apache.org Received: (qmail 25597 invoked by uid 99); 26 Feb 2007 17:16:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Feb 2007 09:16:47 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of the.mindstorm.mailinglist@gmail.com designates 64.233.182.187 as permitted sender) Received: from [64.233.182.187] (HELO nf-out-0910.google.com) (64.233.182.187) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Feb 2007 09:16:35 -0800 Received: by nf-out-0910.google.com with SMTP id q29so1865402nfc for ; Mon, 26 Feb 2007 09:16:13 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VlvAwuxZzaPc6s/UL1s6UKjDj+NKQyx9kTLxfwEO6ZAwA4JEjQDyCFnJXk4yBF57tNhH458Z/YlNriLc5uFIZkYDkQT1ysMNkYhgz4t2kXP9Kkak3fS61TVBKZVSyX4Ra47Iq/UYADpNInkdcNQbv/WPI/zcIxEyy3DGKxh7lkg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=s5ERz83kcv9lEjcoGPyEf8veFmPK/+nTq9iJxHHqWnJQH5pb/D1UYzSddahlCv0wgaerW9PA2Ew3bs5ZsN2DvOXpGxcU4hoOr72TdURwjl+4nZPI0IrLHKm0VlRbSECqGzWfhMQfsSWoIHa0/y9VOqQtj1OuIHDMurGxzDoq0FQ= Received: by 10.82.138.6 with SMTP id l6mr1848346bud.1172510173424; Mon, 26 Feb 2007 09:16:13 -0800 (PST) Received: by 10.82.167.2 with HTTP; Mon, 26 Feb 2007 09:16:13 -0800 (PST) Message-ID: Date: Mon, 26 Feb 2007 19:16:13 +0200 From: "Alexandru Popescu" To: "Struts Developers List" Subject: Re: Guice 1.0rc2 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <690806.24784.qm@web54306.mail.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org On 2/26/07, Bob Lee wrote: > On 2/26/07, Konstantin Priblouda wrote: > > > > Hi Bob, > > I'd like to say that I'm codeveloper of > > pico/nanocontainer. > > > I've used Pico and Nano. Nano uses my AOP framework. You should try Guice. > > > What's important is that you don't depend on the > > > implementation. Depending > > > on the interface and annotation is OK. Strings are a > > > pain. > > > > We do not depend on string keys to dientify components > > - key in container is just object, and is > > needed only in case of ambiguity ( but it could be > > string as well ) > > > Using these key objects is more verbose than using annotations with Guice. > > > > Basically I just register this session component - > > and my HibernateUserManager receives it in > > constructor. > > > > Why do I need an annotation to achieve this? > > > The annotation indicates which constructor you want injected (to the > framework as well as other programmers). What happens if you forget to > configure a PasswordHasher in Pico? No hashing? That's not very secure. > > If you can't annotate a constructor (because you don't control the code), > you can use a custom provider. For example: > > class HibernateUserManagerProvider implements Provider > { > @Inject Session session; > @Inject PasswordHasher passwordHasher; > public HibernateUserManager get() { > return new HibernateUserManager(session, passwordHasher); > } > } > > Well, there is still a question why it is better than > > pico ;) > > > Write less code, and get better up front checking and better performance. > What more do you want? > > Bob > Bob it sounds cool, but without documentation I would say that there are not many chances people will look into it. I will wait for the moment the documentation becomes available. ./alex -- .w( the_mindstorm )p. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For additional commands, e-mail: dev-help@struts.apache.org