4

I want to create a WCF service. What is the best design pattern to do this? For example three seperated projects like this:

1) DataContract
2) BusinessLogic
3) SvcHostProject

Ronald Meijboom
  • 1,534
  • 3
  • 17
  • 37
Nario
  • 551
  • 6
  • 16
  • Any full sample application for Service Layer, using good patterns, and update in 2013 (maybe VS 2012, WCF , .NET 4.5) – Kiquenet Aug 27 '13 at 09:28

2 Answers2

4

That doesn't sound too bad, although I'd probably combine the DataContract and the SvcHostProject as they would both have to reference the WCF binaries and seem to share the same coarse-grained responsibility (that is, unless you are thinking about creating a general-purpose ServiceHost).

You might want to see the (old) post about making WCF services more testable: http://blogs.msdn.com/b/ploeh/archive/2008/07/12/an-overview-of-unit-testing-duplex-wcf-services-and-clients.aspx Although it talks about duplex services, you can easily extrapolate how to deal with more 'normal' request-response services as well.

Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
4

This article helped me a lot http://www.netfxharmonics.com/2008/11/Architectural-Overview-Creating-Streamlined-Simplified-yet-Scalable-WCF-Connectivity

Denis Besic
  • 3,067
  • 3
  • 24
  • 35