ore
 concise but restrictive. Factories decouple the client and implementation
 to some extent but require boilerplate code. Service locators decouple even
 further but reduce compile time type safety. All three approaches inhibit
 unit testing. For example, if the programmer uses a factory, each test
 against code that depends on the factory will have to mock out the factory
 and remember to clean up after itself or else risk side effects:

 <pre>   void testStopwatch() {
     <b>TimeSource original = Defa