Search the web
Sign In
New User? Sign Up
graniteds · Granite Data Services
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Dynamic Custom Externalizers?   Message List  
Reply | Forward Message #4171 of 5334 |
Hi,
I'm using GDS 2.0 with Spring. I have a couple questions on externalizers. I
have some objects with very deep/extensive object graphs. For example, I may
load a Hibernate entity from the db. That entity points to a non-persistent
object, that association has many other associations of non-persistent objects
and so on. In other words, they are not lazy. I usually don't want this
massive amount of data to be brought over to Flex.

a) Is writing a customer externalizer the right approach to limiting how deep I
serialize the object graph?

b) There are many many cases where... for any given object... I want to see
some associations for some functions and other associations for other functions.
In other words, a single externalizer for a given class is usually not enough
for me. I need different externalizers for the same class for different
situations.
So the questions is, is it possible to specify an externalizer to use for a base
object on-the-fly?
I'm guessing the answer is no, it's not built in. But this is really a big deal
for me and am willing to build it myself.. if feasible.
What do you think? If it doesn't sound like a completely bonehead idea... then
I'm hoping someone could help me get started by just giving me a high-level
overview of where in the GDS code I should start.
Here's what I want to do.. when I make a call to the server via Flex/Tide, I
want to pass along some metadata with the request. This metadata tells me on
the server which externalizer(s) to use for the result objects. So I need to
figure out...
- How to pass this metadata (non-function parameters) with the Tide request from
Flex.
- How to access this metadata during the response phase (to determine which
externalizers to use)
- Where to cut in to override the default externalizer and use the requested
one(s).
If I could get those things answered (at least on a high level), then I think I
could be on my merry way.

This would be a huge boost for me. Thanks!!




Fri Jul 3, 2009 7:44 pm

BitRancher
Offline Offline
Send Email Send Email

Forward
Message #4171 of 5334 |
Expand Messages Author Sort by Date

Hi, I'm using GDS 2.0 with Spring. I have a couple questions on externalizers. I have some objects with very deep/extensive object graphs. For example, I...
BitRancher
Offline Send Email
Jul 3, 2009
7:45 pm

Why not just use Hibernate lazy fetching strategies. The whole point of the Hibernate externalizer is to keep the lazy/loaded state of entities without having...
williamdrai
Offline Send Email
Jul 6, 2009
8:15 am

Hi William, The problem is that I have custom 'user types' and these cannot be lazy (as far as I know). For example, maybe I have a persistent entity...
BitRancher
Offline Send Email
Jul 6, 2009
9:03 am

I see, so writing a custom externalizer for your user type is definitely the right thing to do. Per-request lazy loading is more complex, but maybe you can use...
williamdrai
Offline Send Email
Jul 6, 2009
5:13 pm

Ok, I do have it working now how I need it to. If it was a nice, pretty solution, I'd ask if you guys could add it... but right now it's just a messy hack....
BitRancher
Offline Send Email
Jul 8, 2009
6:06 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help