2 ms·
I could be entirely off here, but it seems to me this problem is less present when you send messages instead of call methods. From the perspective of sending m
by mercer 8y ago
I could be entirely off here, but it seems to me this problem is less present when you send messages instead of call methods.
From the perspective of sending messages, the solution is that the knife object/actor sends a message to the cheese object/actor that it wants to cut it. the cheese can then respond to that message by changing its state to 'cut', or perhaps by sending a message back to the knife that it's not sharp enough for this particular chunk of cheese, and that the cheese remains in an uncut state. The knife actor/object could then decide to break, or sharpen itself, or whatever.
I haven't given this much thought yet though, so I'd love to hear how I'm all wrong about this!
EDIT: I guess this comment says something similar: https://news.ycombinator.com/item?id=18333652 https://news.ycombinator.com/item?id=18333652