Case-logic
John Pfersich
jp1660 at att.net
Fri Oct 29 19:16:55 UTC 2004
Lex wrote:
>Blake, the simple answer is to use a separate class per state. Then
>instead of a case statement, you can send messages to the current state
>object and ask it to Do The Right Thing. Since each state has a
>different class, each one can have a separate doTheRightThing method,
>and the normal OO method-binding machinery will hook up the
>doTheRightThing *request* with the appropriate *response*.
>
Sounds way too OO for me :^)
--
----------------------------------------------------
Source code in files. How quaint. -- Kent Beck
More information about the Squeak-dev
mailing list
|