Skip to main content

Posts

Showing posts from February, 2011

Specification Pattern, Entity Framework & LINQ

  Firstly just to clarify I am going to be talking about the OOP Specification Pattern not the data pattern commonly found in the SID (Shared Information & Data) model. Much has been said about the specification pattern so I’m not going to go into that, if you want an overview check out these posts: http://www.lostechies.com/blogs/chrismissal/archive/2009/09/10/using-the-specification-pattern-for-querying.aspx http://devlicio.us/blogs/jeff_perrin/archive/2006/12/13/the-specification-pattern.aspx In this post I’m going to demonstrate how you can make use of the specification pattern to query Entity Framework and create reusable, testable query objects and eliminate inline LINQ queries. The Smell When I first got started with Entity Framework way back in 2008 when EF was still in it’s infancy we had lot’s of inline LINQ all over the code base and specific methods on our repositories for querying requirements (which any OOP purist will tell you is bad). We had a se

Managing Change in Long Running Workflows Part 2

  Recently I wrote about how some of the Serialization problems you can face when dealing with long running workflows. In this post I’m going to cover how I deal with logic changes in persisted workflows and also how you can make logic changes to your workflows without having to deploy code. Hosting the Workflow When it comes to hosting your workflows there are really only two options to consider. Self-Hosting WCF Workflow Service To be honest I only looked at the WCF Workflow Service model briefly and decided it wasn’t the best fit for the requirements as it couldn’t provide the same benefits of self-hosting within a Workflow Application . Workflow Instance Store In order to persist Workflow instances you need to first create the Workflow Instance Store database. For this you will need to use the following scripts: C:\Windows\Microsoft.NET\Framework\v4.0.30319\SQL\en\SqlWorkflowInstanceStoreSchema.sql C:\Windows\Microsoft.NET\Framework\v4.0.30319\SQL\en\SqlWor