You can do that on the client side. Although you don't have
reflections, you can have a helper class which can do that work for
you. That helper class could have a big "if, else if, else if" clause
and compare classes using instance.getClass(). Every time you add a
new class you want to use reflections with, you can add a new "else if
(instance.getClass() == MyClass.class){ return new MyClass(); }"
That was what I did when I needed to use reflections on the client
side.

On 6 ago, 05:07, Stephan T <[email protected]> wrote:
> The reason why I try to do this is that GWT doesn't support
> reflections. I'm trying to use a helper method on the server side
> which receivs the class name, the server side then instatiates the
> class and returns it to the client.
>
> Any other suggestions how to solve this problem?
>
> On 5 Aug, 15:47, Mikael Couzic <[email protected]> wrote:
>
> > Sounds like you violated the SRP principle...
> > If I got it right, Composite depends on the DOM, which doesn't exist
> > server-side, so I don't think it is possible.
> > A solution would be to encapsulate the functionnality you want to use
> > server-side in a POJO. Your composite would then delegate to the POJO,
> > which could be reused server-side.
> > And if you wish to push further towards great design, embrace MVP !
>
> > On 5 août, 14:42, Stephan T <[email protected]> wrote:
>
> > > For several reasons I need to instansiate a Composite on the server
> > > side that is in the client package. Is it possible? Now I think I'm
> > > getting class not found exception when trying...

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to