I'm voting for adjectives I guess. It's typically the way that CDI Qualifiers look when functioning with @Inject. Granted, these aren't qualifiers, but they might as well be by how they behave and actually modify the result of the injection.

I'm 100% sure how I feel about @AutoBound - but I'm not 100% sure about @Bound.


As adjectives:


@Templated

public class Thing extends Composite {

  @Inject
  @Bound
  private TextBox input;

  @Inject
  @AutoBound
  private DataBinder<Model> binder;

}


As verbs:

@Templated

public class Thing extends Composite {

  @Inject
  @Bind
  private TextBox input;

  @Inject
  @AutoBind
  private DataBinder<Model> binder;


}

On Mon, Aug 13, 2012 at 11:31 AM, Christian Sadilek <csadilek@redhat.com> wrote:
Had the same thought. It's @Inject, so I thought @Bind would be more consistent on the data field….but I am fine either way…let's vote :)

On 2012-08-13, at 11:26 AM, "Lincoln Baxter, III" <lincolnbaxter@gmail.com> wrote:

Should it be @Bind or @Bound?

On Mon, Aug 13, 2012 at 10:52 AM, Christian Sadilek <christian.sadilek@gmail.com> wrote:
just forwarding Lincoln's reply. If there are no objections to @Bind
and @AutoBound, I will go ahead and implement this later today or
tomorrow.

cheers,
christian

---------- Forwarded message ----------
From: Lincoln Baxter, III <lincolnbaxter@gmail.com>
Date: Mon, Aug 13, 2012 at 12:05 AM
Subject: Re: [errai-dev] Errai UI and DataBinding
To: Christian Sadilek <christian.sadilek@gmail.com>


I do think we need programmatic control over bindings. I think that
was one of my first questions when we implemented the @Injected
databinder. I agree with you that the current state is a bit too
"magical," and I think that the suggestions you've brough up will help
to eliminate that.

+1 to individual @Bind and also aggregate @Autobind / @Autobound annotation

~Lincoln

On Sun, Aug 12, 2012 at 7:53 PM, Christian Sadilek
<christian.sadilek@gmail.com> wrote:
>
> Hi,
>
> I'd like to propose a change to our DataBinding integration in Errai
> UI. Basically, I think we should retire the implicit binding approach
> and introduce a new annotation. So, within a @Templated class that has
> a DataBinder<T> field, we should have the following options:
>
> 1. No binding
> @Inject @DataField
> private TextBox date;
>
> 2. Binding to model property with matching name
> @Inject @Bind @DataField
> private TextBox date;
>
> 3. Binding to model property with matching name using provided converter
> @Inject @Bind(converter=MyDataConverter.class) @DataField
> private TextBox date;
>
> 4. Binding to model property with provided name
> @Inject @Bind(property="lastUpdated") @DataField
> private TextBox date;
>
> 5. Binding to model property with provided name using provided converter
> @Inject @Bind(property="lastUpdated", converter=MyDataConverter.class)
> @DataField
> private TextBox date;
>
> Additionally, we could add an annotation (e.g. @AutoBind) that when
> present on the @Templated class causes our current behaviour. All
> @DataFields will be bound to model properties with matching names.
>
> I prefer this approach because just by looking at the code I get all
> the information I need to undersand what's going on. Our current
> approach seems a little too magical :).
>
> WDYT?
>
> Cheers,
> Christian
> _______________________________________________
> errai-dev mailing list
> errai-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/errai-dev




--
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."
_______________________________________________
errai-dev mailing list
errai-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/errai-dev



--
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."
_______________________________________________
errai-dev mailing list
errai-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/errai-dev




--
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."