简体   繁体   中英

Best practice using service contracts(one service or multiple) in WCF

Currently i've started developing a wcf service which provides Webshopdata, but something isn't clear enough. In my case i have multiple service contracts like Product, Order, Account and Cart. Each contract has about 10 to 15 methods and they don't inherit form each other.

What would be the best practice in terms of performance and maintenance, built one service which implents all methods(maybe group them by endpoints?) or building one service for each contract?

Thanks!

You can configure the service quality (timeout, message size limits, etc) only per service. You cannot configure these options per method. If you have a need to configure things to such fine detail, you'll need separate services. Otherwise, I don't think there are many hard and fast rules.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM