Hello,
I ran into what I think is a bug in the port of Seaside to VisualWorks. It seems that the WAModelProxy in VisualWorks doesn't actually read values from its cache when a #performRead: is invoked upon it. Here's my sample code:
tmp := WAStoreItem new. tmp description: 'My store item'; price: '5'; subtitle: 'The coolest thing ever!'; title: 'Giant Toy Robot'.
proxy := WAModelProxy on: tmp.
proxy price: '56'. proxy price (just 'do it' to this line and you should see '5').
The above code works fine in Squeak, but not VW. From what I can tell, it depends on how Symbol functions differently in the two apps. When the cache looks up a value using the selector from the message passed to #doesNotUnderstand:, #performRead: uses the selector as a pure symbol (e.g., #price) at which point it doesn't match the key in the cache for 'price', which is a string. Since it is absent, it goes on to get the value from the wrapped model (i.e., from the WAStoreItem in the above example).
For now, I've adjusted my own local version. But I thought I ought to let the list know about this, if it really is a bug. If this isn't a bug, would someone point out the proper usage of WAModelProxy?
Thanks,
Josh
On Mar 27, 2004, at 8:16 PM, Josh Braun wrote:
For now, I've adjusted my own local version. But I thought I ought to let the list know about this, if it really is a bug. If this isn't a bug, would someone point out the proper usage of WAModelProxy?
Yes, that's a bug, thanks. In Squeak, #foo and 'foo' are equal, whereas they typically aren't in other dialects. This has bitten me many times.
Avi
I just stumbled into this problem yesterday while porting ROE to VW. I thought it was a bug in the Squeak code. Thanks for pointing this out. Brett On Sat, 2004-03-27 at 20:24, Avi Bryant wrote:
On Mar 27, 2004, at 8:16 PM, Josh Braun wrote:
For now, I've adjusted my own local version. But I thought I ought to let the list know about this, if it really is a bug. If this isn't a bug, would someone point out the proper usage of WAModelProxy?
Yes, that's a bug, thanks. In Squeak, #foo and 'foo' are equal, whereas they typically aren't in other dialects. This has bitten me many times.
Avi
Seaside mailing list Seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/listinfo/seaside
seaside@lists.squeakfoundation.org