Bernie Cook's Blog

Azure, C#, .NET, Architecture & Related Tech News

Leave a comment

Using dotPeek to Review IL Weaving

dotPeekThere are two types of Aspect Oriented Programming (AOP) in .NET; Interceptors and IL weaving. This post focuses on the later and illustrates how you can use a .NET decompiler to review the code generated by AOP post compilation processing using the IL Weaving approach, albeit the decompiled code.

The most well known AOP framework for .NET is PostSharp, which is what I’ll be using in this post. And one of the more well known .NET decompilers is dotPeek, developed by JetBrains, the company best known in the .NET world for ReSharper. You do have to pay for PostSharp (although there is a trial period), however dotPeek is free and simple to download and execute.

So what I’ve done is provide (1) the source code for a simple .NET console application I’ve knocked together, displaying the resulting decompiled code in dotPeek, then (2) I decorate one of the application’s methods with an AOP aspect and display the resulting decompiled code so you can see what PostSharp has done. Continue reading



Book Review: “Implementing Domain-Driven Design″

Implementing-Domain Driven Design CoverI’m a big fan of the Domain-Driven Design (DDD) principles and patterns so pre-ordered Vaughn Vernon’s “Implementing Domain-Driven Design” prior to it’s release in March this year (2013). Having finished it earlier this week I wanted to do some justice to this invaluable text by posting a blog which provides a synopsis of each chapter, as well as some general commentary about the book.

If you don’t read any further let me say, before you go, that if you’re interested in learning about DDD, or want a modern and comprehensive DDD reference book, then get your hands on a copy. This text easily gets a 5 star rating from me, which is akin to the ratings on and at the time of writing. Continue reading


Saving Changes is Not Permitted – SQL Server

Whether you’re using SQL Server 2008 R2 Management Studio or SQL 2012 Management Studio you may come across this particular warning when attempting to commit changes to an existing table:

“Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can’t be re-created or enabled the option Prevent saving changes that require the table to be recreated.” Continue reading

Leave a comment

Distributed Design: Applying the Command Pattern to Azure’s Web/Worker Roles

WorkerRoleOne place I regularly come across the use of the Command pattern is when working on Azure projects that employ worker roles to execute long running tasks initiated by a scheduled process or user action. The Command pattern lends itself to the distributed nature of these solutions with very little plumbing required when working in Azure.

The following post provides a sample application; CommandQueue which contains 3 examples of a web and worker role utilising the Command pattern. The web role is designed to provide a rapid responses to the user, offloading any lengthy operations to the worker role. The source code for the CommandQueue solution is available on GitHub so feel free to clone, compile and execute it while working through this post.

Continue reading