Return-Path: Delivered-To: apmail-tapestry-dev-archive@www.apache.org Received: (qmail 49467 invoked from network); 4 Oct 2007 01:07:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Oct 2007 01:07:12 -0000 Received: (qmail 88868 invoked by uid 500); 4 Oct 2007 01:07:01 -0000 Delivered-To: apmail-tapestry-dev-archive@tapestry.apache.org Received: (qmail 88840 invoked by uid 500); 4 Oct 2007 01:07:00 -0000 Mailing-List: contact dev-help@tapestry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tapestry development" Delivered-To: mailing list dev@tapestry.apache.org Received: (qmail 88831 invoked by uid 500); 4 Oct 2007 01:07:00 -0000 Delivered-To: apmail-jakarta-tapestry-dev@jakarta.apache.org Received: (qmail 88828 invoked by uid 99); 4 Oct 2007 01:07:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2007 18:07:00 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2007 01:07:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DFF8B71422C for ; Wed, 3 Oct 2007 18:06:50 -0700 (PDT) Message-ID: <30530199.1191460010914.JavaMail.jira@brutus> Date: Wed, 3 Oct 2007 18:06:50 -0700 (PDT) From: "Howard M. Lewis Ship (JIRA)" To: tapestry-dev@jakarta.apache.org Subject: [jira] Assigned: (TAPESTRY-1798) Injection via Marker Annotations In-Reply-To: <31019963.1191336711234.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/TAPESTRY-1798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship reassigned TAPESTRY-1798: ---------------------------------------------- Assignee: Howard M. Lewis Ship > Injection via Marker Annotations > -------------------------------- > > Key: TAPESTRY-1798 > URL: https://issues.apache.org/jira/browse/TAPESTRY-1798 > Project: Tapestry > Issue Type: New Feature > Components: tapestry-ioc > Affects Versions: 5.0.5 > Reporter: Howard M. Lewis Ship > Assignee: Howard M. Lewis Ship > > Currently in IoC, when injecting a service, you are limited to two options: > - Inject by type, assuming exactly one match > - Inject by explicit service id > In a fully featured system both of these are imperfect. > When you take into account the idea that there will be overrides for built in services, then you can't rely on their being just a single match. That's what the Alias service in tapestry-core is all about: contributing to the MasterObjectProvider to handle overrides. Unfortunately, contributions to Alias are clumsy, as they have to rely on @InjectService for disambiguation. > Having to know the service id is a problem, since service ids are not refactoring safe: refactoring the service interface name will likely change the service id, but @InjectService annotation values will still point to the old name. > Imagine instead a marker annotation; no attributes, attached to a type. Maybe it's attached to the service implementation class, maybe its specified to the ServiceBinder. > When injecting, the parameter type and annotations are checked for any known marker annotation (all the marker annotation will be identified at Registry start up). The parameter type is matched against services with the marker, at must be unique for just those services. > An idiom involving a nested annotation named "Local" is likely, thus: > public class MyModule > { > @interface Local { } > @MarkedBy(Local.class) > public MyService buildMyService(@Local OtherService other) { ... > } > I'm fairly certain Guice has something quite similiar. > The question is: can we get rid of service ids entirely? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org For additional commands, e-mail: dev-help@tapestry.apache.org