2013-04-20

Proper event handling in a system

This will be another short post in regards to previously mentioned system about how a system should be structured for proper event handling...

I ran into next big issue, where multiple parts of the system listens to the same update events but where we need one system to be updated first and then the next one.

I really can't find a GOOD way to solve this issue from code. I can find multiple ways to solve it, but none really seems good enough. The usual and easiest way I guess would be that there will be "system wide commands" that is handled by a controller or similar and that that functions in turn calls public functions on other objects or triggers new commands that the model/view listens to.

However, I don't really like that system due to either a lot of public functions or all the issues with trying to debug a flow.

I have really come to like the idea of having a "visual schematic/flow view" where you traverse nodes and then put all synchronization and commands in that place instead of in code. Makes it easier to understand flows and easier to understand where one flow should stop and the next should start etc...

Might have to redo some things on my hobby projet... :o

Inga kommentarer:

Skicka en kommentar