[aerogear-dev] Make id configurable

Marko Strukelj marko.strukelj at gmail.com
Thu Nov 15 08:54:37 EST 2012


I second that.

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:
org.aerogear.android.persistence.Id

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.

- marko


On Thu, Nov 15, 2012 at 2:36 PM, Matthias Wessendorf <matzew at apache.org>wrote:

> -1 on interface - awful to force folks to implement things (hello EJB 2.1
> :))
>
> I _guess_ an annotation would feel natural for java folks, instead of
> applying a "config your pk" :)
>
> -M
>
> On Thu, Nov 15, 2012 at 2:29 PM, Daniel Passos <daniel at passos.me> wrote:
> > Hey Guys,
> >
> > I'm working on AEROGEAR-565 to make id configurable.
> >
> > I've been taking a look at the JS and iOS and apis are very similar, both
> > are getting a configuration parameter with the name of the field that
> > represents the id. I like to see libraries close to but I don't know if
> this
> > the best approach for the android.
> >
> > I'm in doubt in what would be the best solution (for android)
> >
> > * Configuration
> >
> > # Pros
> > It requires no change in entity/model
> >
> > # Cons
> > Use reflections
> >
> > * Interfaces
> >
> > # Pros
> > Typed paras
> >
> > # Cons
> > Requires implement on entity/model
> >
> > * Annotation
> >
> > # Pros
> > Clean configuration
> >
> > # Cons
> > Use Scan/Reflection
> >
> > Anyone have any thoughts or see any other solution?
> >
> > _______________________________________________
> > aerogear-dev mailing list
> > aerogear-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/aerogear-dev
> >
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20121115/f865f2f7/attachment.html 


More information about the aerogear-dev mailing list