This topic came up in a WCF training session (i.e. ObjectSharp's WCF course) I am currently delivering so I wanted to post a few references on the subject here:
The first is "Designing Extensible, Versionable XML Formats" by Dare Obasanjo
The second, slightly more academic treatment is "Extensibility, XML Vocabularies, and XML Schema", by David Orchard, an extensibility guru who has much to say on the topic:
And then finally a series of writings by Tim Ewald which are chock full of extremely powerful Versioning advice:
First his "Services and the Versioning Problem" article in the MS Architecture Journal:
And then a series of blog entries:
I have been doing some Windows Workflow (WF) consulting with a customer lately and I was talking to a developer who had just been thrown onto the project and was struggling with WF, not feeling that he had a solid grasp of the paradigm. No one was more surprised than me when I was able to help him so easily by simply pointing out that WF is an instance of the “Command Processor Pattern”. Because it seemed to help him so much I thought it might be worth sharing here.
Before I get to this however, I just want to state for the record how important I believe the Gang of Four (GoF) Design Patterns book is. I always assume, sometimes incorrectly, that every developer has intimate knowledge of the GoF Design Patterns book. I believe reading it is a right-of-passage for every developer, and I would always steer people towards the original book, as opposed to “knock-offs” that try to “translate it” to another programming language. If you haven’t read it, stop everything and read it!
The Command Pattern
In case you can’t recall it, the authors state the following as the intent of the “Command Pattern”:
Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations
However, I think the essence of it is well captured in the structure diagram:
The Command Processor Pattern
After the GoF authors, the POSA1 authors expanded on the Command Pattern by writing up what they called the Command Processor Pattern, a pattern that built on the Command Pattern to show how easy it is to use it to do things like undo/redo functionality etc. Again, for the sake of brevity, I will only show a single UML class diagram that I think conveys the essence of the pattern:
Later, two of the GoF authors wrote a paper called “Compounding Command” in which they showed how some of the other GoF patterns can be combined with Command in interesting and powerful ways, which I’ll summarize here by once again showing a single UML diagram that I think captures it quite well:
Finally, WF as an Instance of the Command Processor Pattern
Now, mapping these ideas to WF is, I think, as easy as first of all making the following connection:
Activity à Command
WorkflowRuntime à CommandProcessor
Armed with these mappings, then showing the structural relationship of some of the key classes in WF shows very clearly how it can be conceptualized as the “Command Processor Pattern”:
The Value of Patterns
As a final comment: the GoF authors state explicitly that they weren’t doing anything new but rather placing well thought out names to reusable design nuggets that people had been using for years already. The real value in that was evident in the interaction I had this week with that developer: once he thought of WF in the context of the Command Pattern he immediately understood what I was talking about because the pattern name was part of our "shared developer lexicon".
I recently found out that the abstract I submitted for DevTeach, held in Toronto May 12-16, 2008 was accepted. I am very excited about it, both about presenting and attending because I think it is shaping up to be an excellent conference. My talk, called ``The Convergence of SOA, REST and BPM``, is in the Architecture Track (See here http://www.devteach.com/Session.aspx#91 for all the talks in this track).
I`ll try to blog more about what to expect from the talk as I figure it out better myself, but suffice it to say that these 3 pillars of contemporary software architecture are finally coming together for me, at least enough for me to want to talk about it with others :)
I am in the process of writing a new course for ObjectSharp on Windows Workflow Foundation (WF). More details about the course can be found here: http://www.objectsharp.com/training/coursedetail.aspx?id=1145. For even more information, contact our Training Manager, Julie James, at 416-216-4603 (or 1-877-So-Sharp) ext. 1 or via email at Training@objectsharp.com.
Taken along with the existing WCF course http://www.objectsharp.com/training/CourseDetail.aspx?id=1135, students will be given a hands-on guide to building a successful Service-Oriented Architecture (SOA) using the .NET 3.5 platform.
This saturday (March 1st) I will be giving a talk entitled "SOA Using WCF & WF" at the Toronto Code camp 2008. The site is here http://torontocodecamp.net/. My talk is in the .NET Framework track and the schedule for this track can be found at: http://torontocodecamp.net/Sessions/NETFramework/tabid/64/Default.aspx. The abstract for the talk is:
"In the world of SOA it is useful to classify your services into two types: Business Activity Services and Resource (or sometimes Entity) Services. In this demo-centric session we’ll look at how Windows Communication Foundation (WCF) and Windows Workflow (WF) can be used within this classification system. More specifically we’ll look at how WF is an ideal choice to use “inside the boundary” of your Activity Services to carry out the long-running work the service represents."
It looks like there are lots of good sessions so I hope to see you there.
The Visual Studio team at Microsoft is saying (see here http://blogs.msdn.com/somasegar/archive/2007/10/17/f-a-functional-programming-language.aspx for instance) they'll work closely with Microsoft Research to build support for F# into VS. Back in my University days I did a fair bit of ML so this will be like re-uniting with an old friend [:)].