Bernie Cook's Blog

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


5 Comments

Repository Caching with Aspect Oriented Programming

Repository Caching with Aspect Oriented ProgrammingThis post provides a walkthrough of how to implement basic cache handling at the repository layer using Aspect Oriented Programming (AOP). I’ve chosen PostSharp’s AOP framework and built a relatively simple Domain-Driven Design (DDD) solution in .NET to illustrate how it all ties together.

I want delve into too much AOP detail up front other than to reiterate the usual AOP pitch – that it’s an incredibly useful programming paradigm which addresses cross-cutting coding concerns within application development. What does that mean in English? Once you’ve mastered the basic AOP terminology and implementation requirements you can use it to remove a lot of duplicate code that appears throughout your solution. If you’re not familiar with AOP then take a quick moment to watch one of PostSharp’s many introductory screencasts or browse through their documentation. Keep in mind that AOP isn’t OOP as you work your way through the following code, it complements OOP extremely well but doesn’t follow object-oriented principles. Continue reading


4 Comments

Distributed Caching in Azure – Cache Worker Role

In June 2012 version 1.7 of the Windows Azure Platform release was introduced and with it came the new cache worker role. This provided another distributed cache management option for Azure developers alongside the likes of AppFabric Caching, or Memcached, to name a few. There are a number of ways to utilise and configure cache worker roles and this post covers one of them, providing a step by step guide to creating a new cloud solution where a web and worker role (cache clients) share the same cache worker role (cache cluster). Continue reading


Leave a comment

Programmatic SSL AppFabric Cache Integration

I recently integrated Windows Azure’s AppFabric Cache into a solution I’ve been working on and went down the programmatic route as opposed to modifying my solution’s application configuration files.  I initially modified the web.config and app.config files for my web and worker roles respectively, just to see how easy it was to implement caching via that method, and I can say with confidence that Microsoft have made it a complete breeze.  However, my requirements meant that I had to programmatically create the DataCacheFactory and connect to the SSL endpoint for an added layer of security. Continue reading