Reflection API

Discussions for core devs and contributors. Read only for normal forum members to keep the noise low

Reflection API

Postby mzechner » Fri Jan 18, 2013 3:40 pm

The GWT backend has to emulate (read duplicate) a lot of classes because Nate uses reflection all over the place. This includes some of the collections (Array, ObjectMap etc.), utils (Json) as well as scene2d (skin, etc.). This process is rather error prone.

To solve this issue, i propose to implement a simple reflection API, that uses the normal Java reflection APIs on the desktop, and our custom gwt-ref module in GWT. Any code currently using the Java reflection API methods must be changed to use the reflection API.

I think this effort is totally worth it, as i want the GWT backend to be a first class citizen just like the other ones. It offers something other frameworks usually can't offer: html5/javascript output.

I created a new branch in the main repository called reflectionapi. I'll try to create the initial implementation there, and fix up all classes using the Java APIs. For GWT, we'll build an emulation using gwt-ref.

The API will largely follow the classes and interfaces of gwt-ref: https://github.com/libgdx/libgdx/blob/m ... ef/client/
mzechner
Site Admin
 
Posts: 4875
Joined: Sat Jul 10, 2010 3:50 pm

Re: Reflection API

Postby mzechner » Fri Jan 18, 2013 4:00 pm

On a related note: i need to transfer the knowledge on how the reflection stuff works in the GWT project. I propose a quick hangout to do that. Time depends on when Nex is available, he's my #1 brain transfer target.
mzechner
Site Admin
 
Posts: 4875
Joined: Sat Jul 10, 2010 3:50 pm

Re: Reflection API

Postby bach » Fri Jan 18, 2013 6:24 pm

Would love to be in on the brain dump.

Flexible time-wise.

Bach
bach
 
Posts: 713
Joined: Mon Mar 07, 2011 1:50 am

Re: Reflection API

Postby BurningHand » Fri Jan 18, 2013 11:30 pm

I might be available tomorrow midday Arizona time - kids should be at my parents' house. Probably around noon.
IRC: nexsoftware / mobidevelop; GitHub: MobiDevelop;
BurningHand
 
Posts: 2812
Joined: Mon Oct 25, 2010 4:35 am

Re: Reflection API

Postby NateS » Sat Jan 19, 2013 11:10 am

Moar rerflerctern!
NateS
 
Posts: 1979
Joined: Fri Nov 12, 2010 11:08 am

Re: Reflection API

Postby siondream » Sat Jan 19, 2013 4:36 pm

I'm very interested in how the GWT reflection system works because I would like to have a GWT backend for the Artemis Entity Framework. Is there any chance I could be in the hangout?
siondream
 
Posts: 364
Joined: Tue Apr 03, 2012 11:59 pm

Re: Reflection API

Postby BurningHand » Sat Jan 19, 2013 5:35 pm

We'll be having the hangout at 12 MST (about 1.5 hours from now).
IRC: nexsoftware / mobidevelop; GitHub: MobiDevelop;
BurningHand
 
Posts: 2812
Joined: Mon Oct 25, 2010 4:35 am

Re: Reflection API

Postby siondream » Sat Jan 19, 2013 7:33 pm

Oh that's too bad, like I said I'm away for the weekend. Next time guys. I'll wait for the correspondent blog update though! :-).
siondream
 
Posts: 364
Joined: Tue Apr 03, 2012 11:59 pm

Re: Reflection API

Postby mzechner » Sat Jan 19, 2013 9:14 pm

Here's the link to the hangout between me and Nex: http://www.youtube.com/watch?v=UyZgZn25IkI

I'll write up the things in a blog post with links to source, so it's quicker to figure out what's going on.
mzechner
Site Admin
 
Posts: 4875
Joined: Sat Jul 10, 2010 3:50 pm

Re: Reflection API

Postby siondream » Sat Jan 19, 2013 9:35 pm

Thanks a lot!
siondream
 
Posts: 364
Joined: Tue Apr 03, 2012 11:59 pm

Next

Return to Libgdx Development

Who is online

Users browsing this forum: No registered users and 1 guest