freeride-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [FR-devel] Database slot-type addtion


From: Hal E. Fulton
Subject: Re: [FR-devel] Database slot-type addtion
Date: Fri, 2 Aug 2002 11:29:48 -0500

----- Original Message ----- 
From: "Rich Kilmer" <address@hidden>
To: "FreeRIDE" <address@hidden>
Sent: Friday, August 02, 2002 10:24 AM
Subject: [FR-devel] Database slot-type addtion


> Proposed addition of a slot type of 'hash':
> 
> Added methods to slot:
> 
>  #slot.put(key, value) 
>  #slot.get(key) #=> value
>  #slot.is_hash_slot? 
>  #slot.hash # turn slot into hash slot
> 
> Right we could just set the data to a hash like this:
> 
>  slot.data = {}
>  slot.data[key]=value
>  slot.data[key] #=> value
> 
> But modifying the internal object's state as stored in a data slot does
> not propagate notifications events, whereas the new method (hash slot)
> would allow a subscriber to be notified.
> 
> Thoughts?

Well, I see your point where slot.data={}
is concerned. But for the others, we could
make #hash create an object that was a 
subclass of Hash, with the [] and []=
doing notification. Couldn't we? This 
would be more convenient than a #get and
a #put, IMO.

Actually I guess a 'get' operation doesn't
need to notify a subscriber anyway.

Hal





reply via email to

[Prev in Thread] Current Thread [Next in Thread]