Monthly Archives: March 2010

A Response Concerning Semantics And Intention Revealing Code

My previous post talked about some code that was using a null value to cause certain behavior. The general idea behind the post was questioning how I should go about remodeling that part of my code so that it would … Continue reading 

Posted in .NET, C#, Craftsmanship, Design Patterns, Principles and Patterns, Quality | 8 Comments

Application Events: Modeling Selection vs De-Selection as Separate Events?

I’m using my Event Aggregator in my current project to manage communication between a custom control and it’s parent form. This is the same control I talked about in my CQRS Performance Engineering post. It has several drop down lists … Continue reading 

Posted in Analysis and Design, AppController, Craftsmanship, Messaging, Model-View-Presenter | 10 Comments

Side Projects, Community Involvement, Etc.

There was some interesting discussion amongst LosTechies members recently, and one of the things that came out of it was a comment about LT members keeping the community informed on what they are doing in terms of side projects, community … Continue reading 

Posted in Uncategorized | Leave a comment

A Type Safe IDataReader Wrapper

I don’t always use NHibernate… it’s true… in fact, plain old ADO.NET, DataSets, DataTables and IDataReaders can offer some nice advantages when used in the right way at the right time. Today, I found myself writing more IDataReader code and … Continue reading 

Posted in .NET, C#, Data Access, Design Patterns, Pragmatism | 8 Comments

Semantic Code: Migrating From A Chatty Interface To A Simple One With A Data Transfer Object

I’ve worked on several C#/Compact Framework/WinForms projects for handheld devices over the years – most of which have involved a require for users wearing gloves to be able to type on a virtual keyboard. It’s not terribly difficult to implement … Continue reading 

Posted in .NET, Analysis and Design, C#, Principles and Patterns | 1 Comment

CQRS Performance Engineering: Read vs Read/Write Models

I’ve used a lot of different architectures, patterns and implementations that revolve around the core concept of command-query separation (CQS) and the more recent label of command-query responsibility separation (CQRS). The ideas behind these principles help us create code that … Continue reading 

Posted in Analysis and Design, CQRS, Pragmatism, Principles and Patterns | 6 Comments

Role Specific Interfaces: DIP And ISP In Action

I do most of my UI development – in ASP.NET WebForms and in WinForms – with a Model-View-Presenter setup. It helps me keep my application logic separate from my view implementations, makes it possible to unit test the presenters, etc. … Continue reading 

Posted in .NET, C#, Model-View-Presenter, Principles and Patterns | Leave a comment

Don’t Expose IList<T> Just So You Can Assert Against Its Contents

Lately I’ve been trying to return IEnumerable<T> whenever I need a collection that will only be enumerated or databound to something. This prevents me from making changes to the collection outside the context of the collection’s parent entity. The problem … Continue reading 

Posted in .NET, C#, Pragmatism, Principles and Patterns, Unit Testing | 17 Comments

How Ruby Taught Me To DRY Up My Code With Lambda Blocks

I’ve been working in Ruby for my Albacore project over the last 6 or 8 months, and taking every chance I can find to learn how to really use the language effectively. One of the benefits I’m seeing in a … Continue reading 

Posted in .NET, C#, Lambda Expressions, Model-View-Presenter, Pragmatism, Principles and Patterns, Ruby | 5 Comments

When Do You Specify Expected Parameters In Stub Methods?

I’m writing a spec with a mock object that mock object returns data to the class under test. In these situations, I don’t bother asserting that my mock object’s method was called because I know that if it’s not called … Continue reading 

Posted in .NET, Behavior Driven Development, C#, Pragmatism, Principles and Patterns, Unit Testing | 16 Comments