Archive

Archive for the ‘Patterns’ Category

Linq to Events : .Net Reactive Framework

July 26th, 2009 stiiifff No comments

Within the Silverlight 3 Toolkit, there’s a hidden gem called the Reactive Framework (System.Reactive.dll), the new baby of Erik Meijer.

Read more about it here and there.

Although the examples given focus on asynchronous UI, I’m sure people will find very interesting uses for it. This is the kind of tool you wanna add to your framework tool-belt and keep it ready for when the needs come.

Categories: Patterns, Silverlight Tags:

Castle DynamicProxy Tutorial

July 2nd, 2009 stiiifff No comments

A while ago, Krzysztof Koźmic started a blog post series about Castle Project‘s DynamicProxy (DP2).

If you wanna know what the heck are:

  • Proxies with & without target
  • Interceptors
  • Interceptor selectors

Go read his amazing tutorial. I’m sure you’ll learn something ;)

If needed, have  a quick refresh on AOP : here, there & there.

And if you get inspired by DP2 and the Castle Project in general, follow the evolution & suggest new ideas !

Coarse-grained Lock & ORM : Followup

May 31st, 2009 stiiifff No comments

Ayende has a followup post concerning support for Coarse-grained locks in NHibernate.

All I want to be able to do is to define my coarse-grained locks (=> optimistic-lock on aggregate root) in NHibernate’s mapping files … and then forget about it when I know that NHibernate can handle it for me. :)

I will then be confident that changes performed within an aggregate are done in a consistent manner and that concurrency problems are detected without using expensive database locks but using optimistic locking on just 1 table for the whole aggregate.

Categories: DDD, ORM, Patterns Tags: , ,

Transactional Software Memory in .Net

March 14th, 2009 stiiifff No comments

I’ve noticed lately that too few .Net developers really master the topic of Transaction management, which is a pity because it’s really an essential skill in one developer’s toolbox.

A good article, written by the master J. Lowy himself, can be found here, and more specifically about Transactional Software Memory (Transactional<T> generic class). Wanna have fun? Combine that with distributed transaction & WCF ;o)

Categories: Patterns Tags: ,

Cool stuff

February 23rd, 2009 stiiifff No comments

Design principles

January 19th, 2009 stiiifff No comments

Here is a very nice post about the traditional design principles to follow when designing highly-reusable object-oriented class libraries & frameworks:

Design Principles

Update your cheat sheet if you were missing some ;)

Categories: Agile, Patterns Tags: , ,

Dependencies, ownership & lifetime

October 23rd, 2008 stiiifff No comments

A quick post to link Hammett's (creator of Castle Project, Windsor IoC container, and now PM on the MEF project) very interesting article about Dependencies, ownership & lifetime of components.

Distributed Domain-Driven Design

July 15th, 2008 stiiifff No comments

Yves Goeleven, a fellow Belgian .Net architect, has a series of very interesting posts on Distributed Domain-Driven Design (DDDD).

If you're researching about how to design your applications with DDD in mind while still being highly scalable, this paper from Pat Helland (Amazon) is a great source of inspiration (thanks Yves for the link). But don't expect to grasp the full potential of it if you don't have a good understanding of both DDD & Distributed Systems (Entities, Transactions, Workflows, Messaging & Scalability in a SOA world).

Coarse-grained Lock & ORM : Not Supported ?

July 2nd, 2008 stiiifff No comments

A while ago, I tried to apply a coarse-grained lock using NHibernate. I didn’t succeed, although I tried several options. This is a pity as I consider this pattern essential to be able to develop real-world applications (not just pet projects) using DDD. Indeed, how do you handle concurrency on your aggregates if you cannot use a coarse-grained lock ?.

More practically described, your ORM must be able to mark the aggregate root as dirty if one of its (direct or indirect) child is dirty, even though the root itself is not dirty … which implies that the ORM, or at least its change-tracking algorithm, must understand the concept of Aggregate (or let you manually configure all the ‘cascades‘).

By the way, I’m not the only one who tried: check here and there. Unfortunately, up to now, I wasn’t able to find an ORM that natively such a locking pattern … I would be very happy if someone could prove me wrong. :)

Note: I actually had a very good implementation of it working on a project I was working on, more than 1 year ago … It used a custom abstract persistence layer sitting on top of NHibernate. To get this to work I had to write the following:

  • Custom Change-Tracking algorithm.
  • NHibernate Interceptor to plug in the custom Change Tracking algorithm (bypass the default one from NHibernate).

Digressing a bit from the main subject of the post, they are other advanced functionalities of NHibernate that can easily be customized:

Categories: DDD, ORM, Patterns Tags: , ,

Dependency Injection is Dead ? Not so sure about that

July 2nd, 2008 stiiifff No comments

Simon Ice has an interesting, although a bit provocative, post on his blog entitled Dependency Injection is Dead.

He's exposing a way to do Dependency Injection using AOP, which is a novel approach but probably has severe limitations in the long run, in terms of predicability & capability compared to what we can expect from good IoC Containers. Read the answers of Nate Kohari and Ayende Rahien, who know what they are talking about. ;)

Categories: Patterns Tags: , ,