Re: std::string bad design????
Mathias Gaunard wrote:
Le Chaud Lapin wrote:
Associative_Set::<String__, Phone_Number> phonebook;
// Add several entries to phonebook.
, and I want to change the telephone number of "Le Chaud Lapin".
Instead of having an "update key value function", I first "locate" the
row that contains my name, then assign to the right-hand-side of the
located element:
phonebook.locate("Le Chaud Lapin");
phonebook.RHE() = "08 70 35 19 38";
State machines are against OOP.
And against multithreading also.
Uneasy as that code makes me feel, state machines are fine in OO. All
objects maintain their own state, that's part of the definition of an
object.
Here is an OO state machine in Javascript (on my web site). Perfectly
fine by OOP standards. It uses an OO technique called "instance
behaviour". I'll be publishing the C++ version at a future date.
http://www.kirit.com/Implementing%20a%20state%20engine%20using%20instance%20
behaviour
K
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]