We feel that learning by example is one of the easiest ways to get started with Windows Workflow Foundation (WF) and Windows Communication Foundation (WCF).  In fact, we find that we often use code samples internally to get people from different feature teams all on the same page.  Therefore, it seemed only natural to think that others outside of Microsoft would benefit from the same types of samples.  We took these existing samples, cleaned them up and added more to fill in gaps to cover as much of the product as we could.  The result was our current sample set: downloadable here and documented here.

With beta1, the product unit authored and shipped 88 new samples for WCF and WF 4.  The samples themselves have been organized by type: Basic, Scenario and Application for WF and Basic, Scenario and Extensibility for WCF.  Basic samples are samples that demonstrate basic usage of a specific feature.  Think of these samples as the hello world of each feature.  Scenario samples show the usage of a set of features used in tandem.  They show specific use cases of our product and apply basic features to demonstrate common patterns.  The extensibility section for WCF exists to conform to the 3.0 WCF sample layout in MSDN Library.  Think of these samples as demonstrating ways to extend WCF beyond its built-in feature set.  Application samples show how many patterns can be used together to provide an end-to-end solution to a common problem.

We see each type of sample fulfilling the needs of different learning and usage styles.  For example, basic samples can be used to quickly familiarize yourself with specific features.  Scenario samples can be used to see what we feel are common patterns for WF and WCF.  These were common enough patterns that several scenario samples actually started as product code that was later move to a sample for one reason or another.  Of the scenario samples, I’d like to specifically call out the WF Activity Library.  This provides a number of activities that were not built into the product but we felt to could be used in many different applications (for example, there’s a SendMail activity, a Regex activity, a For Activity, and many more).

The WCF sample set, like the product changes, are additive.  This means that most of the pre-4 WCF samples are still relevant.  However, the samples currently shipped in the download linked to above are just for new features in Beta1.  In Beta2, the samples download will also include most of these samples shipped with 3.0-3.5sp1.  The new WCF samples include, Discovery, Event Tracing for Windows, Routing services, and more.

Look them over, let us know what you think by commenting on this post and responding to the WF and WCF code sample survey.  We do take your feedback seriously.  Need help with a particular scenario but couldn’t find a sample that demonstrated a similar pattern?  Others are probably in the same boat – letting us know can help us make learning WF and WCF easier for you and others moving forward.