Best practice for large WCF service?

前端 未结 5 1179
时光说笑
时光说笑 2021-01-29 21:52

What is the best practice for writing a rather large wcf service, containing a lot of OperationContracts and DataContracts?

How would I separate functional areas into se

5条回答
  •  无人共我
    2021-01-29 22:41

    I'll go off the track here and say I've used monolithic WCF contracts, functionally separated contracts (with a maximum of ten methods along Juval's guidelines in his book), and I've also tried a message handling architecture where a service has a single method that takes a base message, and handlers that 'know' how to unwrap and process the message after it crosses the wire.

    I'm a big fan of the latter if you've got .NET on both sides of the fence. Oren has a screencast on the idea with code. I don't know what your needs are but this is working for me.

    http://ayende.com/Blog/archive/2008/03/30/Hibernating-Rhinos-8--Going-Distributed-amp-Building-our-own.aspx

    That said if you're already coming from "I need a large WCF service" then going to one method is probably not going to cut it for you. If that's true then Juval Lowy's Programming WCF Services is the standard you should uphold in your design.

提交回复
热议问题