Some References on Extensible XML Schema Design

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
http://www.xml.com/pub/a/2004/07/21/design.html?page=1

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:
http://www.xml.com/pub/a/2004/10/27/extend.html

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:
http://msdn2.microsoft.com/en-us/arcjournal/bb245674.aspx

And then a series of blog entries:
http://pluralsight.com/blogs/tewald/archive/2006/04/14/21733.aspx
http://pluralsight.com/blogs/tewald/archive/2006/04/25/22704.aspx
http://pluralsight.com/blogs/tewald/archive/2006/05/05/22961.aspx
http://pluralsight.com/blogs/tewald/archive/2006/05/05/22963.aspx

WF as Command Pattern

Compounding Cmd

Posa1 Cmd Processor

Command

Windows Workflow and the Command Processor Pattern

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:

Compounding Command

Later, two of the GoF authors wrote a paper called “Compounding Commandin 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".

 

Presenting at DevTeach in May

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 :)

New WF Course

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.

Upcoming Presentation at Toronto Code Camp 2008

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.

Time to dust off my old ML & Haskell textbooks?

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 [:)].