Partial Demo Code - Neuparts.Shipping WCF Domain-Driven Service
I said, way back here, that I was working with another Neudesic Principal Consultant, Chad Thomas, on two WCF demo services/applications for my SOA with WCF and ESB talks. That talk, as many have noticed, spends a whole hour on Architectural, Domain-Driven and Software Patterns that I believe are neccessary to design and develop a quality WCF Service. The second hour of the talk is on WCF. I now will be giving you 1/2 of that code that has been used in the two New Jersey groups as well as the Chicago CNUG presentation. What was lacking was a real demo - I always showed crappy Hello WCF demos :). I wanted to show more and use some of my learnings but at the same time not take siz months to build a full domain-driven application.
The code reflects my current learnings. I have really Steve Eichert to thank, in the last 2 years of working together, having a very profound and deep influence on me with Domain-Driven Design and particuarly the Repository Pattern. We also learned a lot about how to organize complex Visual Studio solutions with lots of projects as well as reflecting the actual layered design. In that sense, we were heavily influenced by the directory structure generated and promoted by the Web Services Software Factory. We also used the Wilson O/RM Mapper.
Meanwhile, Chad was leading .NET development projects at JP Morgan Chase and also heavily using DDD, Business Entities, Repositories, TDD and Domain-Mapper. Chad has a lot of experience with the same areas I am interested in.
So, when Chad and I started doing this, we wanted to use all that we had learned and not make it "just another demo." Reemember, my stinky WCF demos were like Hello WCF! :) We wanted to reflect what we knew to be good patterns and practices in building a WCF Service. So to that end, the code:
- Uses the Layer Architecture pattern with a Service Layer Pattern, Business/Domain Layer and a Resource Layer behind the WCF Service
- Service Adapter Pattern with Translator pattern to translate between Data Contracts (in the Service Interface layer) and Business Entity
- Practical example Domain layer using Evans Entities, Repositories, and Factories
- O/RM using NHibernate
- NUnit tests (needs work)
- Visual Studio Solution, Project and Folder layout for a Services application
This is the work in progress. This is a working demo of an end-to-end WCF Shipping Service along with its Service Interface Layer, Business Entity Layer, NHibernate Repository and NUnit tests. This was used for the NJ User Groups, and Chicago.
-
Requires directory C:\neudesic.Source for now
-
You have to configure the config files for your database
-
Requires Visual Studio 2005
-
Requires SQL Server 2005
-
Requires .NET Framework 3
DISCLAIMER: This is incomplete. Not all unit tests are complete. There is no fancy packaging. We have full-time jobs on other stuff so this is NOT production code. There is no exception handling or logging. This is only 1/2 of the solution. The Ordering WCF system is coming. We will be putting all this on CodePlex for the community at which point we will involve the community in helping this go forward.
DOUBLE DISCLAIMER: This is NOT a DDD talk or demo. It is for a SOA with WCF talk and is a WCF demo. We wento to this extra effort because we believe it is the way that WCF services (and software) should be built. But it should not be viewed as a complete or conclusive illustration of a DDD application.
Get the current code here CODEPLEX PROJECT now here
[tags: C#, F#, Domain Driven Design, NHibernate, O/RM, Indigo, WCF, Design Patterns, Windows Communication Foundation, Sam Gentile]
