Sunday, December 11, 2011

Re: One type for all

"RequestFactory is nice if you have access to the backend"

I'm using AutoBeans (which were designed for RequestFactory) to
marshall and unmarshall my model classes on the client side without
having access to the server side. I don't have a JEE server or even a
servlet container as I'm using CouchDB. My models are interfaces
annotated as EJB3 POJOs but also annotated with validations. And I'm
exporting them from CouchDB to an RDBMS using Hibernate. So I have
models that are used for the client side, a NoSQL and an RDBMS.

Think it through ... you'll get there too!

smoyer

On Dec 11, 6:23 am, Ed <post2edb...@gmail.com> wrote:
> I don't think there is a perfect solution currently.
> It all depends on your situation.
>
> The RequestFactory is nice if you have access to the backend, as this
> mechanism requires a "further" integration between the backend and
> frontend. But not everybody has access to this part of the backend but
> merely "the web layer backend" on top of the backend that handles all
> the front-end communication.
> However RequestFactory is very efficient.
>
> If you only want parts of the domain object (DO) to be transfered to
> the front-end (like in my case), you need to create DTO and convert
> DTO <-> DO which costs time to fine tune all and is fragile (make sure
> you test it well). I use Dozer, but had to make my own dozer branch
> due to bugs and extra requirements.
>
> I understood that Java 7 would offer extra DTO functionality, no idea
> what the current status of this is.
>
> - Ed
>
> On Dec 10, 2:50 pm, Thomas Broyer <t.bro...@gmail.com> wrote:
>
>
>
>
>
>
>
> > This is (partly) what RequestFactory tries to solve (vs. GWT-RPC): you no
> > longer use your server-side classes on the client-side, so you don't have
> > the issues of your entities having to be "translatable" by the GWT compiler.
>
> > If you work with JSON (using things like Jackson or GSON on the
> > server-side), you can use AutoBeans on the client-side (you can also use
> > them on the server-side, btw) to easily parse and manipulate the objects
> > (at least a bit more easily than with JsonUtils.safeEval() and JS Overlay
> > Types).
>
> > But if you only add annotations to your classes, there's no reason you
> > couldn't use them on the client-side too; you just have to make sure you
> > have the source code for the annotations on the classpath too.
>
> > Just a suggestion; AutoBean and RequestFactory are not a silver-bullet, and
> > JSOs and GWT-RPC are still viable choices (FYI, Google Groups uses GWT-RPC).

--
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate