Friday, June 9, 2017

[WRONG] ChatNode architecture

A [WRONG] rudimentary version:
It should be understood that a chat node has a member called Responder that is currently responsible for handling text in and out. The outermost Responder is always in use but sometime is set to one of the sub nodes or sub sub nodes. It is still a brittle architecture.

Here a chat node "home" constructs a sub node during its __init__(). When it constructs the sub node, it passes itself into the sub node as a member 'Parent' of the sub node. Later events can pass control to the sub node via setResponder() and back to the home via restoreControlToParent().
In this way the home node can decide when to handoff responsibility to the sub chat, but it might not get control back. In practice the home node delegates a sub topic to the sub node and gives it responsibility for what to do next.
Example: a Yes/No sub chat can be initiated from a home node, store the result, and return control to the home. It is up to the home node to not lose the context that the question applied to. ETC ETC.

No comments:

Post a Comment