Reflection API

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

Re: Reflection API

Postby mzechner » Sun Jan 20, 2013 12:27 am

blog post: http://www.badlogicgames.com/wordpress/?p=2764

warning, very long. What can i say, it's complicated :p
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: Reflection API

Postby BurningHand » Tue Apr 09, 2013 2:12 pm

As I was doing some cleanup of the GWT backend yesterday, I was reminded of this initiative and thought I'd take a stab at getting the ball rolling on it. Just posting here to get any thoughts before I dive in.
IRC: nexsoftware / mobidevelop; GitHub: MobiDevelop;
BurningHand
 
Posts: 2812
Joined: Mon Oct 25, 2010 4:35 am

Re: Reflection API

Postby mzechner » Thu Apr 11, 2013 11:55 am

Awesome! I think the interfaces/classes in the GWT backend should give good guidance on how to go about writting the API. If you need any help, let me know!
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: Reflection API

Postby BurningHand » Thu Jun 06, 2013 9:24 pm

It has been a while, but I've done some work on this... I think I am getting there and shouldn't be too far off from completion. Probably will need dome changes but I feel pretty good about it so far. You can see the work I'm doing at the github repo, reflectionapi branch. Any input before I get too much farther along would be great.
IRC: nexsoftware / mobidevelop; GitHub: MobiDevelop;
BurningHand
 
Posts: 2812
Joined: Mon Oct 25, 2010 4:35 am

Re: Reflection API

Postby mzechner » Sat Jun 08, 2013 11:52 am

Wow, awesome. Only thing i saw was ClassReflection and ArrayReflection. Not sure we need to separate those? I let you decide.

Nate should also give it a looksy.
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: Reflection API

Postby BurningHand » Sat Jun 08, 2013 10:12 pm

Alrighty, moved ArrayReflection and ClassReflection out to their own files and got rid of the Reflection class. Also added exception messages and docs. I want to do one more pass through the GWT emulation to make sure everything is okay there but otherwise I think we're good to go (pending any additional review/feedback).
IRC: nexsoftware / mobidevelop; GitHub: MobiDevelop;
BurningHand
 
Posts: 2812
Joined: Mon Oct 25, 2010 4:35 am

Re: Reflection API

Postby NateS » Tue Jun 11, 2013 9:09 am

Looks good, seems that everything is covered. Should remove all TODOs before merging.

Minor nitpick, here are my personal OCD rules for exception and log messages:

1) If a single value:
"Something something: " + value
This is succinct since you need only 1 string and 1 plus, looks nice, makes all messages look similar, and means you don't have to dork around with quoting the value (which also looks bad when the value has quotes).

2) Multiple values:
"Something something: " + value1 + ", something: " + value2

Rarely does a message not look good with one of these two formats.

3) I like to be consistent between "Error doing stuff", "Unable to do stuff", "Stuff not found", etc. Doesn't matter which is picked.

Eg:

Code: Select all
throw new ReflectionException("Class " + name + "could not be found.", e);
throw new ReflectionException("Class not found: " + name, e);

throw new ReflectionException("No field with name '" + name + "' for class '" + c.getName() + "'.", e);
throw new ReflectionException("Field not found: " + name + ", for class: " + c.getName(), e);
NateS
 
Posts: 1980
Joined: Fri Nov 12, 2010 11:08 am

Re: Reflection API

Postby BurningHand » Tue Jun 11, 2013 12:58 pm

Cool, thanks for the feedback Nate.

I agree, that does look cleaner. I'll go ahead and get that updated.
IRC: nexsoftware / mobidevelop; GitHub: MobiDevelop;
BurningHand
 
Posts: 2812
Joined: Mon Oct 25, 2010 4:35 am

Re: Reflection API

Postby BurningHand » Thu Jun 13, 2013 1:46 pm

Alrighty, I cleaned up the messages in core. I'll add them to the gwt emulation and then, if no one objects, I'll go ahead and merge to master.
IRC: nexsoftware / mobidevelop; GitHub: MobiDevelop;
BurningHand
 
Posts: 2812
Joined: Mon Oct 25, 2010 4:35 am

Previous

Return to Libgdx Development

Who is online

Users browsing this forum: No registered users and 1 guest