
13 Mar
2005
13 Mar
'05
4:27 p.m.
Alexander Nasonov wrote:
Peter Petrov wrote:
Probably. But it cannot support state-local storage in the same sense as this library. (otherwise, I like it)
What's wrong with my approach?
Suppose that we have nested states, and we use state-local storage in the outer state. Now, for as long as we don't leave the outer state, (only making transitions between its inner states), it is natural to keep its storage. I.e. the lifetime of the storage should be the same as the logical lifetime of the state. Judging from your brief description of your approach, I presume that leaving an inner-state will also destroy the outer-state, since they are the same object (you said: "inheritance is used to model states hierarchy").