Saturday, May 26, 2012

Re: Howto? include an outside JAR (separate project) with business objects that can be used on the Server and in the Browser Client

From your response, maybe I was thinking too deep... My thought was that
the GWT compiler does something special with BO's that are in the shared
package such that a javascript client side representation is generated
for the browser to use when serializing/deserializing the BO to/from the
server when passed over the RPC and must therefore have access to the
source (or at least the .class files to use via reflection) By
deduction, then does this mean that the GWT compiler reverse engineers a
javascript browser based javascript object based on inspection of
possible call hierarchy inspection and therefore can get the information
needed from the JAR just referenced in the pom.xml so as to be bundled
in the built _.war file?

While a big fan of the right pattern used in the right place I often
avoid the mapping and (get/set copy) of PO to BO to perhaps DTO to the
client and instead use a BO wrapper object that provides a view (MVC but
with a twist - it is a data view not a JSP view) in a specific business
object. Sometimes this is coupled with custom CODEC classes for
marshalling (serializing) / demarshaling (deserialzing) in a given usage
context. The decoder being a custom factory with a stream as a
constructor param.

-------- Original Message --------
Subject: Re: Howto? include an outside JAR (separate project) with
business objects that can be used on the Server and in the Browser Client
From: Joseph Lust <lifeoflust@gmail.com>
To: google-web-toolkit@googlegroups.com
Date: 05/26/2012 06:25 AM

> Jiji,
>
> It sounds like you've almost got everything you need. You just need
> to include the dependency for your BO package in your GWT project
> POM. Myself and others use a similar design as you do, with BO in one
> project and GWT UI in another file.
>
> To clarify, you can use the BO's in both the GWT client and server
> side code. Unless your BO's are not RPC serializable, they should
> just work out of the box for you. If they are not serializable to
> RPC, you'll need to make some DTO's to get them to the clientside.
> You could also use DTO's if the BO's have way more data than needed
> in them, to cut down on data transmission quantity/time.
>
>
> Sincerely, Joseph
>
> -- You received this message because you are subscribed to the
> Google Groups "Google Web Toolkit" group. To view this discussion on
> the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/kNy2t8EUP6kJ. 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.

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