I’ve revised the table of contents to give some detail on what each of the articles is about:
A guide to these two core concepts without the need to understand dependency injection or WorkItems. Explains what a composite application is and why we might want one, and shows a naive application that uses the CAB to run three separate projects simultaneously without them referencing each other. Also explains some of the mysteries of how CAB applications behave at start-up.
A quick initial look at WorkItems, explaining their importance both as containers of code and as a hierarchy that allows us to control the scope of the code.
A discussion of dependency injection and why it’s useful in general, without reference to the Composite Application Block. A code example is given. The relationship to the strategy pattern is examined, as well as the various different types of dependency injection.
A discussion of the concepts of inversion of control and dependency inversion, and how they relate to dependency injection. Again these concepts are discussed without direct reference to the Composite Application Block.
This article finally revisits the Composite Application Block, showing how we can use dependency injection to get hold of WorkItems in projects that are not conventionally referenced, and hence access the objects in their containers. It discusses the various ways of doing dependency injection in the CAB using the attributes ComponentDependency, ServiceDependency and CreateNew, and gives an example illustrating this. It further discusses the ObjectBuilder briefly, and explains how dependency injection works in the WorkItems hierarchy.
A brief article on how to use constructor injection with the CAB, and why we might not want to.
Discusses what services are in general, what they are in the Composite Application Block, and how the Services collection differs from the Items collection. Gives a basic example, and an example of splitting interface from implementation in a service.
Dives into services in much more detail, including an in-depth examination of the various ways of creating and retrieving services.
Another article looking at some theory without direct reference to the Composite Application Block: explains the command pattern, how it relates to .NET, and why its a good thing if you’re writing menus.
Shows how to use Commands in the Composite Application Block to hook up clicks on menus to their handlers. Explains why we might want to do it this way rather than with the more usual .NET approach using events. Looks at how to handle Status with Commands, the parameters passed to a CommandHandler, and discusses writing your own CommandAdapters to handle other invokers than menus. Gives a CommandAdapter example.
Recaps the usual events in .NET and explains why we might want something simpler. Gives a basic example of the Composite Application Block’s alternative approach.
Goes into detail of what we can do with the Composite Application Block’s events: examines the handling of scope, how the EventTopics collection works, use of the ThreadOption enumeration to ensure that our event executes on the GUI thread, more flexible event handling with AddSubscription and RemoveSubscription, hooking up .NET events to CAB events with AddPublication, and how to disable CAB events.