[Helma-user] markAsClean

Joshua Paine joshua at papercrown.org
Mon May 5 04:16:31 CEST 2008


On Sun, 2008-05-04 at 18:49 -0700, Kris Leite wrote:
> In my case, it was much better to 
> create HopObject fields with default values.  If the user changed the 
> default values, then they are stored.  If nothing was entered, then
> the default values are not stored reducing storage overhead.

This would probably be even better accomplished like this:

this.__defineGetter('favColor',function(){
  return this.favColor_ === undefined ? 'red' : this.favColor_;
});
this.__defineSetter('favColor',function(val){
  val == 'red' ? (delete this.favColor_) : this.favColor_ = val;
  return val;
});

-- 
Joshua Paine <joshua at papercrown.org>



More information about the Helma-user mailing list