Archive for the ‘Design’ Category

Design Guidelines for LINQ

Have you wondered if and when you should use the new LINQ features in .Net 3.5? Like, where should I put a new extension method? Should I use Func<T> or a custom delegate? How do I best implement a mix-in (extension methods on an interface)? Well, Mircea Trofin has just published a new draft of [...]

More »

Mix 08 WPF Scheduling Application

Mix 08 seems to be much more mature than ever before. In previous years there were a lot of ideas being spoken about; this year there are much more implementations of those ideas available to look at. It seems like a lot of people have been working on the new technologies over the past year [...]

More »

How to Update Data with LINQ-to-SQL

When learning LINQ-to-SQL, it’s not immediately obvious how to do an update. Querying is easy, and there are methods for inserting and deleting. Updating usually occurs by modifying an object already known to the DataContext and then calling SubmitChanges on the context. var product = (from p in dataContext.Products where p.ProductID == 1 select p).Single(); [...]

More »

ASP.Net MVC Corollary – What to do?

Dude! I got quoted! And by none other than Rob Conery of SubSonic fame. It seems like my last post caused quite an unexpected stir. Thanks to both Rob and Scott for taking the time to answer me. I really appreciate it.

More »

Does the ASP.Net MVC Framework Frustrate You?

Silverlight, ASP.Net Ajax, LINQ, Astoria, ASP.Net MVC – there’s just tons of stuff coming out of Microsoft. And that’s not to mention the stuff people have seemingly forgotten about – ASP.Net Futures with IronPython (AWOL), Patterns and Practices Web Client Software Factory, WPF, WF, WCF and CardSpaces. Now the trend seems to be functional programming [...]

More »

Calculating the Fibonacci Sequence with C# 3.0

Scott Hanselman just posted his latest article in his weekly source code series. He shows various ways of producing the Fibonacci Sequence using various languages. I found it really interesting, for two reasons: I tried to do the C#3.0 one on my own after listening to a podcast about F#, and never could work it [...]

More »

Using LinqPad to Create a Time-Selector Drop-Down List

I am really getting into LINQ now! I think it’s fantastic. I recently wanted to develop a quick drop-down list in ASP.Net which allows a user to select a time of day from a list. The times are 15 minutes apart, so the list would look like this: … 08:00 08:15 08:30 08:45 09:00 … [...]

More »

A simple Mix-in with C# 3.0

Heard of mix-ins? They’re an alternative to multiple inheritance, made popular recently by Ruby. Basically, you can use them to “mix in” methods from an interface with their implementations into a class. In Ruby you can do this by including a module in a class. In C#, you do it by implementing an interface and [...]

More »

Qualities of a .Net Application Design

I’m often asked to produce design documents for new applications. I can’t do this without discussing the advantages and disadvantages to each part of the design. A great way to do this is to focus on the desired qualities of the system you’re trying to build. Define the qualities you are trying to achieve, and [...]

More »