Is there any reason to keep the WCF interface in a separate file? -


just personal style, guess, hate having 2 files wcf services. tend copy/paste interface .cs file have deal single file.

any dangers in doing this?

not dangers per se - there times when useful have separate assembly service, operation , data contracts (just contracts, interfaces, basically) - when need share between server , client side.

there's no point in sharing whole service implementation code (the actual service class, implements service interface), client.

plus: if have interfaces in separate file (and possibly assembly), makes easier write unit tests, if want mock service. gets bit messy if mix interface , class single file.

so consider useful , helpful best practice have separate files interfaces , implementations (actually: 1 class per file only), , put service- , data contracts (and fault contracts) separate assembly.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -