Thursday, 17 July 2014

Multiple project configurations


  1. I want different 'app.config's for debug and release builds.
  2. I want to be able to define a boiler-plate app.config and 'tweak' it depending on the project's configuration
  3. I want to have some global (solution-wide) configuration parameters (e.g. WCF addresses which need to match up between my servers and various client apps).

Thursday, 10 July 2014

Factory methods within a class can access private members.

There are times when I want to hide construction details and provide a factory method within the class to create objects.

I've found it handy for dependency injection, test classes, etc

Here's one of the patterns I've been using:


Here's an insight into my 'Dispose' pattern -- so I can copy/paste into my next class :)