Event Based Programming

time to read 1 min | 135 words

I think that this is the hardest one for me to grok. The problem is that just about anyone can subscribe to an event, and my model is based so if you subscribe to the event, you can change the state of the object.

Now, consider what happens when normal events, delegate actions and explicit code are mixed. It’s surprising to see the results, to say the least.  Add that to the normal difficulties of debugging GUI and you get a nice problem.

I made a mistake and wrote code-first stuff, and I couldn’t figure out why the test was failing. Turned out that I already implemented the functionality, and I got duplicated results. It gets interesting since everything has an event, and at least some of this stuff is dynamically subscribed.