Appendix F. WCF Coding Standard

A comprehensive coding standard is essential for successful product delivery; it helps in enforcing best practices and avoiding pitfalls, and it makes knowledge dissemination across the team easier. Traditionally, coding standards are thick, laborious documents, spanning hundreds of pages and detailing the rationale behind every directive. While these are better than no standard at all, such efforts are usually indigestible by the average developer. In contrast, the WCF coding standard presented here is very thin on the “why” and very detailed on the “what.” I believe that while fully understanding every insight that goes into a particular programming decision may require reading books and even years of experience, applying a standard should not. When absorbing a new developer into your team, you should be able to simply point the newcomer at the standard and say: “Read this first.” Being able to comply with a good standard should come before fully understanding and appreciating it—that should come over time, with experience. The WCF coding standard presented in this appendix captures dos and don’ts, pitfalls, guidelines, and recommendations, drawing on the best practices and helper classes discussed throughout this book.

General Design Guidelines

  1. All services must adhere to these principles:

    1. Services are secure.

    2. Service operations leave the system in a consistent state.

    3. Services are thread-safe and can be accessed by concurrent clients.

    4. Services ...

Get Programming WCF Services, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.