DDDD: Producers and Consumers

About a year ago, Greg wrote a good article on producers and consumers. It's an excellent read but is a little too abstract if you're brand new to DDDD. I would strongly recommend reading (at least three times) each of the previous blog posts from Greg in the DDDD series and watching all of the videos as listed in my Getting Started post.

Fortunately, Greg is very active in the Domain-Driven Design Yahoo Group. Because of this, there are little gems that can be extracted by following his posts. Before I post the link, I must say that often times message boards replies—and the corresponding original question(s)--don't have have an adequate amount of context to be able to decipher them properly. [E.g. "What is the marital status of the number five?"] The reason for this is that there is a mountain of knowledge being brought to bear on the subject and only little flakes come through in a response.

Greg's blog post was about a year ago, but his technique, per this thread, has evolved slightly since that time—as techniques should over time and experience.

In his original blog post he lists three separate interfaces, IConsume, IProduce, and IPublish. In the aforementioned thread, it has been consolidated to two—Consumes (notice the missing "I" prefix) and IPublish—but the total number of methods remains the same: three.

The great thing about the IPublish interface is that it's pretty much a pipes and filters interface which, as he mentions in the thread, allows you to do a lot of really cool things—queuing, serialization (sending through a message channel), changing thread boundaries, etc.