This week I gave a talk at TechEd focusing on architectural considerations as well as some useful tips for creating n-tier applications with the Entity Framework v3.5SP1.  The code from the simple sample application is now available at http://code.msdn.microsoft.com/dtl401sample/.  It includes:

  • an Entity Framework-based Business Object and DAL
  • some rudimentary validation implemented using a T4-template to create customized code generation with an OnValidate partial method much like is available from LINQ to SQL
  • a repository which abstracts the UI from data access & a fake implementation of that repository
  • an asp.net MVC-based UI with URL routing that allows you to specify either to run on the fake repository or on the real one
  • a WCF implementation of that repository which remotes calls from the web tier to the midtier
  • several unit tests

Have a look and let me know what you think.  Of course this is not the end-all-be-all of anything.  It’s just a sample designed to illustrate a few concepts, but maybe someone will find it useful.

- Danny