Domain Driven Design: Thought of the day

Entities Entities are important. Maintaining the identity of an object is an important way to avoid data corruption. “Their class definitions, responsibilities, attributes and associates should revolve around who they are, rather than the particular attributes they carry” Eric Evans: Domain Drive Design – Tackling Complexity in the Heart of Software

3

MVC LINQ and OOP

I just had an interesting conversation with the co-editor of this blog which went something along the lines of… BigMart: I haven’t had chance to dig into LINQ properly but I don’t like it Me: But delayed execution rocks (follow long rambling explanation) BigMart: For our next project I won’t be using that MVC rubbish Me: But it rocks! OK …

MVC and good software design

Just found an excellent article summarising various software design principles/concepts in one easily digestible post. The series will eventually cover building a robust application using Microsoft’s ASP.NET MVC. http://weblogs.asp.net/stephenwalther/archive/2008/09/05/asp-net-mvc-application-building-forums-1-create-the-perfect-application.aspx

ASP.NET MVC Test Framework integration

One of the exciting aspects of asp.net mvc is it’s inherent support for Test Driven Devleopment. This post outlines how to make NUnit and RhinoMocks appear as options when generating a test project during creation of a new MVC app. http://blogs.msdn.com/webdevtools/archive/2008/03/06/asp-net-mvc-test-framework-integration-demo.aspx And an updated post for Preview 3 http://blogs.msdn.com/webdevtools/archive/2008/05/30/asp-net-mvc-preview-3-tooling-updates.aspx

2

On a different note

Totally unrelated to the rest of the blog I just wanted to congratulate Shrewsbury Town FC on a fantastic win at the weekend. Supporting my home town team was something of a chore last year so Saturday’s free flowing football was a refreshing change.

ASP.NET MVC Custom Controls

Just spotted this article over on singingeels. http://www.singingeels.com/Articles/Building_Custom_ASPNET_MVC_Controls.aspx Looks like a useful read if you’re keen to use MVC but are concerned about Tag Soup

Abstracting your Dependency Injection framework

I’ve used various Dependency Injection frameworks in the last year or so and have yet to settle on any one in particular. My focus has been on StructureMap and Microsoft’s Unity (I know I know everyone seems to dislike the latter for some reason but it does have its uses!). On a couple of occasions I had to switch DI …

Model *View* Controller

A lot is being made of Microsoft’s Model View Controller (or MVC) framework at the moment. I have only spent a couple of days working with it so far but it does look promising. If you are a TDD convert or just interested in solid OOP principles such as separation of concerns it may well be right up your street. …

Code 39 Mod 43 Checksum

I needed to do some work with barcodes recently, specifically I needed to handle Code 39 Mod 43 barcodes. Given a barcode string this function should return the relevant Mod 43 checksum. public class Code39     {         ///<summary>         ///Returns the expected checksum for the specified barcode         ///</summary>         ///<param name="barcode"></param>         ///<returns></returns>         public string ValidateMod43(string barcode)         {             int subtotal = 0;             const string …

3

Log4Net Custom Appender

Log4Net is an excellent logging framework which neatly separates the specifics of your logging implementation from your business logic. The upshot is that you can write code such as Log.Error("An error occured") in your code, and configure the logging somewhere else (usually app/web.config). To actually process the output you use Appenders. Log4Net has several built in appenders for logging to …