Saturday, September 4, 2010

Re: How to send data back to client side code?

Hi,

I published few days ago a very small framework helping you to move
complex data models to client through the GWT/RPC mechanism and back.

It's the "pojo-framework" and you can find it here:
http://code.google.com/p/pojo-injector/

Basically you cannot move complex data models to client, because you
risk to put almost anything into the shared folder to make GWT able to
compile it! Furthermore GWT doesn't like very much interfaces; it
prefers to work on concrete classes...

So one solution is to pass through POJOs objects (clones of your data
models) not implementing all the interfaces of your original data
model (essentially you build an easier hierarchy of classes that you
can put into the shared folder)...

With this simple solution, you write a lot of POJOs (clones of your
data models) *AND* a lot of adapters (to fill your POJOs and to read
back the data model from POJO)!!!

I looked around for a simple solution, but I didn't find something
fitting my simple needs: so I implemented the "pojo-framework".
With the pojo-framework you still need to write your POJOs, *BUT* you
avoid to implement all the adapters...

I hope it can help you...

Best regards,
Carlo Alberto

On 13 Ago, 19:39, "Sree ..." <gattasrika...@gmail.com> wrote:
> Am not sure this belongs to GWT or GAE or both ...
>
> So here's my problem...
>
> I have one client/Example.java [contains all GWT code] calls a methods on
> server/SomeServiceImpl.java [Contains code to talk to dataStore]
>
> Wat server/SomeServiceImpl.java does is Featch data from Employee.Java
>  .... [this is class used to store data in datastore JPA]
>
> So now my problem is.. as long as I send data in the form of String or
> StringArray to client/Example.java am fine, but now I tried to send
> List<Employee> to client/Example.java
>
> Doing so throws me an error as below..
>
> Validating newly compiled units
>       [ERROR] Errors in
> 'file:/C:/XXX/XXX/src/xxx/client/GreetingServiceAsync.java'
>          [ERROR] Line 18: No source code is available for type
> xxx.server.Employee; did you forget to inherit a required module?
>       [ERROR] Errors in 'file:/C:/XXX/XXX/src/client/Example.java'
>          [ERROR] Line 325: No source code is available for type
> xxx.server.Employee; did you forget to inherit a required module?
>       [ERROR] Errors in 'file:/C:/XXX/XXX/src/client/GreetingService.java'
>          [ERROR] Line 19: No source code is available for type
> xxx.server.Employee; did you forget to inherit a required module?
>    Finding entry point classes
>       [ERROR] Unable to find type 'xxx.client.Example'
>          [ERROR] Hint: Previous compiler errors may have made this type
> unavailable
>          [ERROR] Hint: Check the inheritance chain from your module; it may
> not be inheriting a required module or a module may not be adding its source
> path entries properly
>
> --
> -Thanks
> -Srikanth.G
> -Hyderabad

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

No comments:

Post a Comment