Posts Tagged .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

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

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

db4o: Transparent-Persistence

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 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

db4o: Client-Server and Concurrency

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 post

,

9 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

db4o: Single Object-Container Concurrency

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 post

,

No 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