Reflection or anything similar on the client?

1 view
Skip to first unread message

Thomas Meeks

unread,
May 18, 2006, 12:19:11 AM5/18/06
to Google Web Toolkit
I'm fairly certain the answer is no, but just in case.

Are there any reflective libraries or methods available to the client?

Specifically I'd like to invoke a method based off the contents of a
String.

Mat Gessel

unread,
May 18, 2006, 2:40:06 AM5/18/06
to Google Web Toolkit

Simp

unread,
May 18, 2006, 4:19:40 AM5/18/06
to Google Web Toolkit
> Specifically I'd like to invoke a method based off the contents of a
> String.

I don't see why that needs reflection.
if(string.compareTo("something")) {
object.invokeSomething();
}

Strobhen

unread,
May 18, 2006, 11:40:52 AM5/18/06
to Google-We...@googlegroups.com
What if you don't know what kind of Object that "object" variable is at runtime?
What if those objects could potentially change rather often?
What if you want to do that over 200 objects with about 10-15 methods each?

Technically you could replace a lot of reflection with the longest
string of if statements ever seen by manking, but there is a reason
people don't.

That's where reflection becomes necessary. I highly recommend you take
a closer look at it, reflection can be very powerful. For example, it
is a nice way to make GUI components that automatically update a java
object when changed in Swing.

But I can do without in this particular case.

Simp

unread,
May 18, 2006, 12:18:40 PM5/18/06
to Google Web Toolkit
I didn't say refelection was a bad thing to have. All I said was:

> I don't see why that needs reflection.
May I emphasise for you:
> I don't see why _that_ needs reflection.
;)

Thomas Meeks

unread,
May 18, 2006, 12:39:39 PM5/18/06
to Google Web Toolkit
Because I don't know what kind of Object "object" is at runtime

:)

Strobhen

unread,
May 18, 2006, 12:42:02 PM5/18/06
to Google Web Toolkit
Compile time, oops
Reply all
Reply to author
Forward
0 new messages