Some notes on this podcast that I think are of importance...
Ted states that event based programming differs from event driven systems. An example of an event driven app is a windows GUI. These event driven programs do nothing until receiving event and then handle it internally. Event-based applications, on the other hand, basically operate upon upon internal communications between different parts of the application that are hooked together to provide functionality through event based communications.
Dynamic Routing is stated as being one of the important things about this type of programming. Dynamic routing is where handlers for events can be changed at run-time. In event based systems this is fixed at runtime. Event-based applications can change the configuration on the fly. To do this, several constructs are used:
- Builders - instantiate all the objects in the system
- Binders - provide communications channels between systems
- Coordinators - provide orchestration between objects through binders
The key point is that binders preserve the decoupling of sources of events from their listeners. This is important to be able to ensure flexibility, independent development, and independent testing of the components. A builder puts together all entities that will be wired, and then passes control to a binder which wires the individual components. Binders then wire up all the observers to subjects.
description of switch statements being used as a means for demultiplexing data moved over a single communications channel. At some point some data is created, then through one code path (the communications channel) a decision is made to go different ways. This inherently bad for concurrency and scalability, and handling through bindings is much more scalable.
Also raised was a concern about the .NET/WPF model of events and passing argugments to the event through classes as a parameter. To create your own events, you must necessarily then create an event arguments class. This therefore causes class explosion as you need to make a new class for every event just to pass the arguments. I totally agree with this as I think its a total pain to have to go through this.
Ted has a book on this topic. I have not read it yet: Event-Based Programming: Taking Events to the Limit.
I'm curious to see if he gets into topics of Invasive Software Composition. I recommend the book on this by Uwe Assmann. This book discusses a number of topics, but which I would describe as mostly discussing AoP and connection of software components through connectors, ports and adapters. It's also a good read if you are into SOA and BPEL, as (at least to me) it gave good clarification on the use of communications channels (SOAP/REST) between components (Web Services) and transformation (XSLT) of data (XML) across the channel.
Where this ties into the discussion that Ted had is that Assmann (boy that's a bad name in the US) would do the "binding" with AoP constructs, basically injecting the bindings between the components at runtime through dependency injection (DI). I would also tend to say that the bindings could not also be done this way, but also through generic programming using policy classes, as well as havnig routes between objects be able to be modified dynamically through having the injected policies either change or make decisions on the data.
This last point gets into another SOA tennant (a reason I brought it up earlier) which is know as content based routing. Typically, this is done on an enterprise service bus through logic attached to the bus, but within an application, a very flexible model of routing of data as well as code flow could be set up with a good combination of AoP, DI and event based architecture.