Re: markAsClean
Joshua Paine <[email protected]> Sun, 04 May 2008 22:16:31 -0400
| Newsgroups | gmane.comp.java.helma.general |
|---|---|
| Message-ID | <1209953791.1997.70.camel@Lenny> |
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 <[email protected]>