Monthly Archives: June 2008

Separation of Concerns by example: Part 3

We made quite a bit of progress separating out the concerns in Part 2, but there are still some issues with our current design.  Other parts in this series include: Separation of Concerns – how not to do it Separation … Continue reading 

Posted in LINQ2SQL, Patterns, Refactoring | 6 Comments

When a space isn’t a space

I ran into a scenario recently where this test failed: [Test] public void You_have_to_be_kidding_me() { string a = “You have to be kidding me “; string b = “You have to be kidding me       “; a.ShouldEqual(b); } It took me … Continue reading 

Posted in C# | 8 Comments

Entity Framework vote of no confidence

As was announced initially (as far as I can tell) on Bil Simser’s blog, some concerned citizens of the .NET world put out an online vote-of-no-confidence concerning the Entity Framework: Letter List of signatories Somewhere on the list you’ll find … Continue reading 

Posted in EntityFramework | 5 Comments

Separation of Concerns by example: Part 2

Separation of concerns is one of the fundamental tenets of good object-oriented design.  Anyone can throw a bunch of code in a method and call it a day, but that’s not the most maintainable approach.  So far, we’ve looked at: … Continue reading 

Posted in Refactoring | 13 Comments

Separation of Concerns by example: Part 1

In the prelude to this series, I looked at a snippet of code that took the kitchen sink approach to concerns.  Here’s what we started out with: public class CustomerManager { [DataObjectMethod(DataObjectMethodType.Select, false)] public static List<Customer> GetCustomers(int startRowIndex, int maximumRows) … Continue reading 

Posted in Refactoring | 6 Comments

Adios, Netflix profiles

It was a good run.  But it looks like your creators are giving you the axe, judging by the email I received today: We wanted to let you know we will be eliminating Profiles, the feature that allowed you to … Continue reading 

Posted in Rant | 5 Comments

Separation of Concerns – how not to do it

In a recent article on layered LINQ applications in the latest ASP.NET PRO magazine (no link, you have to pay), the author proposes separating your application into three distinct layers: User Interface (UI) layer Business Logic Layer (BLL) Data Access … Continue reading 

Posted in LINQ2SQL, Refactoring | 18 Comments

Some improved LINQ operators

I ran across a couple of scenarios the other day that were made pretty difficult given the current LINQ query operators.  First, I needed to see if an item existed in a collection.  That’s easy with the Contains method, when … Continue reading 

Posted in C#, LINQ | 11 Comments

Forbidden Void type in C#

I’ve had this come up a couple of times.  I’d really like to be able to do something like this: Func<bool, Void> whyNot = test => Console.WriteLine(test); This is equivalent to: Action<bool> okThisWorks = test => Console.WriteLine(test); Although an actual … Continue reading 

Posted in C# | 5 Comments

Designing primary keys

When creating a primary key for a table, we have a few options: Composite key Natural key Surrogate key Each has their own advantages and disadvantages, but by and large I always wind up going with the last option. Composite … Continue reading 

Posted in DomainDrivenDesign, SQL | 26 Comments