Friday, May 22, 2009

DDD with WCF

Most books and articles explain how to use DDD with "one-server" architecture. But when you try to design a distributed architecture (ui and business layer), things get harder.

It is generally accepted that it's better not to distribute your application (see Martin Fowler's First Law of Distribution), but sometimes it is necessary.

In my opinion WCF services are "application services" of DDD. They provide access to the business layer.


The main problem of this architecture is that entities must live only on the business layer, because entities have methods that musn't be executed on the ui layer.

To solve it, it is necesary to create datacontracts (DTOs) in order to pass information between both layers and to map them with each entity.

0 comments: