Changing prototype chain as state machine
dave at nexttolast.com
Wed Sep 28 00:28:18 UTC 2011
In one of the Self papers it states that assignable parent slots can be useful. And then it is largely an ignored subject from then on.
I've been ressurrecting this idea for a web framework which models core finite state machines by exploiting assignable parent slots to only expose methods sensible for that state.
eg. A response object has no header:Value: after the headers have already been sent, and a closed socket has no read or write: or close methods, but does have an open:
When I'm building these objects there is some default behavior that needs surpressing, specifically firing up the debugger when an unknown message send is encountered. This is heavily inspired by Randy's ARK unknown methods fall through.
Where this has become critical is building large scale distributed applications with transparent proxies forwarding messages. Which may hit an object multiple times due to resend logic.
Do any of the wise ones on the list know of any applications using these approaches?
If not, why?
-=-=- dave at nexttolast.com -=-=-
More information about the Self-interest