You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Rob Dennett <ro...@tmit1.org> on 2005/09/26 20:42:50 UTC
Datasqueezers and strategies
I created a simple component that takes a complex class as a parameter and iterates over it, outputting one of its values. When I initially tried to run this, I got an exception saying, “Could not find a strategy instance for class Foobar”.
I made the class in question implement Serializable (although I didn’t define a serialVersionUID), but now I get a NotSerializableException. The class in question contains a list of other objects as well. Do I need to create a datasqueezer adaptor for this? Why? What do they do, exactly?
Also, if I am dealing with a complex object graph, is it inappropriate to pass it to a component?
Thanks for your help,
Rob
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.6/111 - Release Date: 9/23/2005
Re: Datasqueezers and strategies
Posted by Kent Tong <ke...@cpttm.org.mo>.
Rob Dennett <rob_dennett <at> tmit1.org> writes:
> I made the class in question implement Serializable (although I didn’t
> define a serialVersionUID), but now I get a NotSerializableException.
> The class in question contains a list of other objects as well. Do I
> need to create a datasqueezer adaptor for this?
No. Just make sure the objects in the your object graph are all
Serializable.
> Why? What do they do, exactly?
So that they can be stored as strings in the HTML page in the browser.
The strings will be turned back into objects on rewind.
> Also, if I am dealing with a complex object graph, is it inappropriate to pass
> it to a component?
To cut down the network traffic, you may want to just store their keys
in the HTML page. To do that, use the "converter" or "keyExpression"
parameter of the "For" component.
--
Author of a book for learning Tapestry (www.agileskills2.org/EWDT)
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org