cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: [CForms] Repeater: why not hashCode for id?
Date Mon, 28 Mar 2005 12:35:43 GMT
Sylvain Wallez wrote:
> Carsten Ziegeler wrote:
> 
> 
> hashCodes are not supposed to be unique, even if the default 
> implementation in Object /may/ use the memory address as hashCode!
> 
Yepp, that's true - but usually for your own business objects you know
if hashCode is unique or not.

> Personally, I find this repeater binding stuff very complicated. I cases 
> where all data of the underlying application data are displayed in a 
> form, I use the simple-repeater binding that first destroys the 
> collection before recreating it from scratch. Up to now, it has 
> fulfilled 80% of my needs.
Ah, didn't know the simple-repeater binding, but in my use-cases I can't
destroy the objects and recreate them :(

> 
> A suggestion I made once to simplify the repeater binding when using 
> simple-repeater isn't possible is to store the objects as attributes of 
> the rows they are bound to during load (see 
> widget.{get/set}Attribute()), and later use that information to recreate 
> the collection on save. I guess this is similar to what you suggest, 
> except it would use strict pointer equality (i.e. '==') instead of 
> hascodes which may not be unique.
> 
Yes, right. I find it really annoying to add an identity property just
because the repeater requires it. This means that the forms framework
has an influence on my data model and that is simply bad.
So are there any problems with implementing your suggestion?

Carsten

-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Mime
View raw message