I second that. <div><br></div><div>Java folks is used to JPA @Id annotation. I'm not saying we should introduce a dependency on JPA, but we could have our own: <a href="http://org.aerogear.android.persistence.Id">org.aerogear.android.persistence.Id</a></div>
<div><br></div><div>Checking for annotation is one tiny method, that will be hidden away from the user. It can also be done smartly - you can cache the result of the scan. </div><div><br></div><div>- marko</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Nov 15, 2012 at 2:36 PM, Matthias Wessendorf <span dir="ltr"><<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-1 on interface - awful to force folks to implement things (hello EJB 2.1 :))<br>
<br>
I _guess_ an annotation would feel natural for java folks, instead of<br>
applying a "config your pk" :)<br>
<br>
-M<br>
<div><div class="h5"><br>
On Thu, Nov 15, 2012 at 2:29 PM, Daniel Passos <<a href="mailto:daniel@passos.me">daniel@passos.me</a>> wrote:<br>
> Hey Guys,<br>
><br>
> I'm working on AEROGEAR-565 to make id configurable.<br>
><br>
> I've been taking a look at the JS and iOS and apis are very similar, both<br>
> are getting a configuration parameter with the name of the field that<br>
> represents the id. I like to see libraries close to but I don't know if this<br>
> the best approach for the android.<br>
><br>
> I'm in doubt in what would be the best solution (for android)<br>
><br>
> * Configuration<br>
><br>
> # Pros<br>
> It requires no change in entity/model<br>
><br>
> # Cons<br>
> Use reflections<br>
><br>
> * Interfaces<br>
><br>
> # Pros<br>
> Typed paras<br>
><br>
> # Cons<br>
> Requires implement on entity/model<br>
><br>
> * Annotation<br>
><br>
> # Pros<br>
> Clean configuration<br>
><br>
> # Cons<br>
> Use Scan/Reflection<br>
><br>
> Anyone have any thoughts or see any other solution?<br>
><br>
</div></div>> _______________________________________________<br>
> aerogear-dev mailing list<br>
> <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Matthias Wessendorf<br>
<br>
blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
</font></span></blockquote></div><br></div>