[Borges-users] StateHolder II

Слепнев Владимир slepnev_v at rambler.ru
Fri Apr 30 04:03:44 EDT 2004


>Which would return an object wrapped in a StateHolder? 

Yeah. And move the register_for_backtracking from StateHolder's 
constructor into Session#state_holder. Users should use this instead 
of creating a new instance. StateHolder will only consist of 
attr_accessor :contents.

Rationale: session.state_holder(contents) is shorter than 
Borges::StateHolder.new(contents), and the association with a session 
is explicit (not magical for the app developer). Also, 
Session#register_for_backtracking and Session#state_holder pair up 
nicely: one backtracks the instance variables, the other backtracks 
the value of the object reference. Also, one dependency less on the 
:current_session hack. Also it will be easier to add a StateHolder to 
a Session from outside it (if someone would ever need that =)

Vladimir Slepnev


More information about the Borges-users mailing list