Re: RPC Serialize: set filter at runtime to select fields to serialize

2011-08-29 Thread Alex Dobjanschi
I would go with DTO. From your post, I get that you don't want lazy-load -- 
if that's so, why don't you disable it? 
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/performance.html#performance-fetching

-- 
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/-/PjW0yh2pQdcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RPC Serialize: set filter at runtime to select fields to serialize

2011-08-28 Thread Saul Simhon
Thank you. Interesting. Well, the gilead annotations are useless to me
since they are not runtime parameters. The code you posted looks
interesting. I will play with it. Ideally, the controller can compute
or inject a list of property names (field names), or a map of property
names with filter qualifiers, that is then used to filter the
serialization. I did not see anything like this in your code, but will
take a closer look!


On Sun, Aug 28, 2011 at 5:23 PM, Juan Pablo Gardella
 wrote:
> Do you see gilead and transport annotations? For me is intrusive but perhaps
> its help to you. I like use filters instead, you can see in this sample.
> Juan
>
> 2011/8/28 saul 
>>
>> I am trying to find a way to control, during runtime, what members of
>> an object are RPC serialized at the server. For example, say we have a
>> POJO and an server side access control filter that only grants access
>> to certain fileds of the object.  Resolving the access rights of the
>> request may require us to hide certain fields' values from the
>> response differently for different requests. One may suggest to simply
>> set the fileds that are not accessible to null before returning the
>> object, but this wil pose issue with persistant, cached or immutable
>> POJOs. Further, a feature such as lazy-loading in hibernate becomes
>> difficult to manage without the using DTO. Using DTO or cloning an
>> object is possible but inefficient in the programming model.
>>
>> Is there a way that at runtime, one can set a serialization filter
>> such that any fileds that are defined in the filter will not be
>> accessed during serialization (and hence will not trigger a lazy load)
>> on the server an instead will be serialized as nulls?
>>
>> The particular flow is something like:
>>
>> RPC client request -> deserialize on server -> request access control
>> logic -> request data filter ->  app logic -> response access control
>> logic -> response data filter ->  serialize response
>>
>>
>>
>> --
>> 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+unsubscr...@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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RPC Serialize: set filter at runtime to select fields to serialize

2011-08-28 Thread Juan Pablo Gardella
Do you see gilead and transport
annotations?
For me is intrusive but perhaps its help to you. I like use filters instead,
you can see in this
sample
.

Juan

2011/8/28 saul 

> I am trying to find a way to control, during runtime, what members of
> an object are RPC serialized at the server. For example, say we have a
> POJO and an server side access control filter that only grants access
> to certain fileds of the object.  Resolving the access rights of the
> request may require us to hide certain fields' values from the
> response differently for different requests. One may suggest to simply
> set the fileds that are not accessible to null before returning the
> object, but this wil pose issue with persistant, cached or immutable
> POJOs. Further, a feature such as lazy-loading in hibernate becomes
> difficult to manage without the using DTO. Using DTO or cloning an
> object is possible but inefficient in the programming model.
>
> Is there a way that at runtime, one can set a serialization filter
> such that any fileds that are defined in the filter will not be
> accessed during serialization (and hence will not trigger a lazy load)
> on the server an instead will be serialized as nulls?
>
> The particular flow is something like:
>
> RPC client request -> deserialize on server -> request access control
> logic -> request data filter ->  app logic -> response access control
> logic -> response data filter ->  serialize response
>
>
>
> --
> 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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



RPC Serialize: set filter at runtime to select fields to serialize

2011-08-28 Thread saul
I am trying to find a way to control, during runtime, what members of
an object are RPC serialized at the server. For example, say we have a
POJO and an server side access control filter that only grants access
to certain fileds of the object.  Resolving the access rights of the
request may require us to hide certain fields' values from the
response differently for different requests. One may suggest to simply
set the fileds that are not accessible to null before returning the
object, but this wil pose issue with persistant, cached or immutable
POJOs. Further, a feature such as lazy-loading in hibernate becomes
difficult to manage without the using DTO. Using DTO or cloning an
object is possible but inefficient in the programming model.

Is there a way that at runtime, one can set a serialization filter
such that any fileds that are defined in the filter will not be
accessed during serialization (and hence will not trigger a lazy load)
on the server an instead will be serialized as nulls?

The particular flow is something like:

RPC client request -> deserialize on server -> request access control
logic -> request data filter ->  app logic -> response access control
logic -> response data filter ->  serialize response



-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.