Posts Tagged .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 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 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 postdb4o: Transparent-Persistence
Posted by gamlerhart in db4o on December 2, 2009
It has been a while since I’ve wrote my last post about db4o. You may remember the post about the activation-mechanism. Don’t you think that this is quite painful? Activating objects with the right activation depth and so forth? Wouldn’t it be nice if db4o actually activates the objects as soon as you need then? [...]
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 postdb4o: Client-Server and Concurrency
Posted by gamlerhart in db4o on November 6, 2009
So far we’ve always used a single object container. This it the simplest way to used db4o. Just open an embedded database an use it. In this post I’ll give a short introduction to the client-server-features of db4o. Handling concurrency is more challenging in a server-client scenario, therefore I also loose a few words about [...]
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 postdb4o: Single Object-Container Concurrency
Posted by gamlerhart in db4o on October 15, 2009
Today nearly every application has some concurrent parts. In a classic desktop-application some work is done in the background to keep the application responsive. In a web-application more than one request are handled concurrently. There’s no escape from the challenges of concurrent programs. (All posts of this series: the basics, activation, object-identity, transactions, persistent classes, [...]
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