N-tier solutions using Microsoft’s ORM, Entity Framework (EF), have been hard to implement across service boundaries, largely due to the difficulty of reporting changes to the EF’s ObjectContext.
EF 4 (released with .NET 4 & VS 2010) includes a Self-Tracking Entity Generator using T4 templates to create POCO classes that can be used to serialize/de-serialize objects (with change tracking).
A small LOB application’s data schema will be used to generate a model, the model will be slightly massaged in the designer, the T4 template will generate the POCO classes, architecting the solution into multiple projects will be reviewed, a self-hosted WCF service will be built, and a client demonstrated which shows an end to end N-Tier solution using Request-Reply operations.
Then, a disconnected and asynchronous SOA will be shown using One-Way operations (with MSMQ) between two (or more) databases. This requires the use of “business” keys to identify “aggregate root” entities.
C# extension methods, generic methods, and functional programming techniques are employed in the framework supporting the demonstrated N-Tier ORM based architecture.