Archive for category .NET
Exception-Handling: BeginInvoke vs ThreadPool.QueueUserWorkItem
Posted by gamlerhart in .NET, software-development on June 30, 2010
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 postVS 2010, Resharper 5.0, JIT geek stuff and Doctor Who
Posted by gamlerhart in .NET, Media Zap Oh Snap, java, software-development on April 14, 2010
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 postManaging 1:N and N:N Object Relations
Posted by gamlerhart in .NET, java, software-development on March 15, 2010
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 postThe Way of the Whiteboard, Modern Hardware, Writing DSLs with LINQ and Component Relationships
Posted by gamlerhart in .NET, 42, software-development on January 25, 2010
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 postdb4o: Tools For Adhoc Querying And Modification
Posted by gamlerhart in .NET, db4o on January 15, 2010
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 postAutofac 2.x
Posted by gamlerhart in .NET on January 14, 2010
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 postMaven-Reference, Validation and Geek-Videos
Posted by gamlerhart in .NET, 42, channel 9, people on January 6, 2010
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 postA Better INotifyPropertyChanged Implementation
Posted by gamlerhart in .NET on November 25, 2009
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 postLINQ: cast-catch
Posted by gamlerhart in .NET on November 4, 2009
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 postMaybe-Monad (Or The Better NullReference)
Posted by gamlerhart in .NET on October 12, 2009
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