Erik Hatcher wrote:
> Regarding using a rich (i.e. not a String or simple type) object as a
> parameter in a DirectLink - this is not really recommended in the
> general sense. The URL is going to be hideous and perhaps even too long
> for some browsers to handle.
>
> A trick within Tapestry, though, would be to use a custom DataSqueezer
> that serialized only the primary key and a unique prefix, and then
> "deserialized" by fetching again using the facility Andrus describes
> below. I have not tried this route - have others?
>
> Erik
>
I haven't, but it's a good idea that solves the problem exactly once.
I just did a quick once-over of the DataSqueezer implementation... there
are some questions still lurking in my mind about this approach.
1) In order to "deserialize" the object, you're going to need access to
the correct DataContext from within a custom adaptor. If you store the
datacontext in the visit, then this could be solved by using a
ThreadLocal Engine approach, I suppose. Or, you could use the utilities
provided by andrus for binding a dc. to a thread, and getting the thread
local dc. Correct me if I'm wrong, Erik, but, at least in tapestry 3.0,
wouldn't you need to sublcass BaseEngine anyway to override
createDataSqueeezer() to return an instance that contains the custom
squeeze adaptor?
Robert
This archive was generated by hypermail 2.0.0 : Thu Mar 31 2005 - 09:19:59 EST