Archive for category .NET

Exception-Handling: BeginInvoke vs ThreadPool.QueueUserWorkItem

Sometimes small changes make have a large impact. An example is the exception-handling difference of Delegate.BeginInvoke and ThreadPool.QueueUserWorkItem. I’m working on a WPF-client application, which does quite a lot of work in the background. Most of the background work is handled by a special task coordination class. For a long time this class executed tasks [...]

Read complete post

,

No Comments

VS 2010, Resharper 5.0, JIT geek stuff and Doctor Who

Visual Studio 2010 is here, and I will upgrade soon. Unfortunately the pricing is unfair for us Europeans =(. Just in time for the VS 2010 the new version of Resharper is here. \o/ Cliff’s posts about the work of a JIT-compiler are always fun to read. First a post about call conventions and mixing [...]

Read complete post

, , , ,

No Comments

Managing 1:N and N:N Object Relations

When you design a domain model you normally have lots of 1:n and n:n relations. Many developers are quite familiar how to translate such relations into a relational model. But how do you translate such relations into an object-model? There’s no hard guideline for that. In this post I explain what I usually do. The [...]

Read complete post

,

1 Comment

The Way of the Whiteboard, Modern Hardware, Writing DSLs with LINQ and Component Relationships

The Way of the Whiteboard: Persuading with Pictures: A enlightening and wonderful talk about explaining stuff with pictures. The advices in this talk do not only apply to every area. Watch it. There’s actually a predecessor talk here, with very similar content. His book is on my ‘to-buy’-list. =) In the presentation ‘Not Your Father’s [...]

Read complete post

, , , ,

No Comments

db4o: Tools For Adhoc Querying And Modification

Remember my very first post about db4o? There I’ve made the statement that the tool-support is very bad. Well I don’t revise my opinion here. The situation is still bad compared to the relational database world. Mostly that’s because relational databases have a giant user base, are well known and have some common interfaces (JDBC, [...]

Read complete post

,

No Comments

Autofac 2.x

A new version of favorite dependency-injection-container Autofac is making progress. It follows the same principals, brings some new features etc. However they also refactored the API, so it isn’t compatible with the older versions. This means, that migrating to the new version is some work. However there are useful new features. Lots of them I’ve [...]

Read complete post

, ,

No Comments

Maven-Reference, Validation and Geek-Videos

I’ve stumbled over this Maven online book. It’s quite useful for everyone who’s maintaining Maven-builds. This post about “Magic” null argument testing describes how to implement an extremely elegant way to check arguments in C#. The check looks like this: new { argument,anotherArgument }.CheckNotNull(); Read the post to find out how it works. Do you [...]

Read complete post

, , , , ,

No Comments

A Better INotifyPropertyChanged Implementation

The INotifyPropertyChanged-interface and companions are a well know citizens of the .NET-framework. How do you implement this interfaces?. Does it look similar to this? public class Person : INotifyPropertyChanged { private string firstname = “”; /* Other fields for the properties */ public event PropertyChangedEventHandler PropertyChanged; public string Firstname { get { return firstname; } [...]

Read complete post

,

No Comments

LINQ: cast-catch

In this post I’ll explain a little catch in LINQ, which may some beginners fall into: What’s the difference between those two queries? IEnumerable<Person> listOfEntities = LoadData(); // First version of the query var resultV1 = from p in listOfEntities where p.Name.Contains("a") select p; // Second version of the query var resultV2 = from Person [...]

Read complete post

, ,

2 Comments

Maybe-Monad (Or The Better NullReference)

The Maybe-Monad sounds like some magic, but it’s something terrible simple. Its a computation which returns a result or ‘Nothing’. Often the a null-reference is used to represent ‘Nothing’. This is common practice, but in my opinion this isn’t a elegant solution. First you have to read the documentation to know that the function may [...]

Read complete post

4 Comments