Changes between Version 47 and Version 48 of ProgrammingGuidelines


Ignore:
Timestamp:
07/12/11 16:59:35 (8 years ago)
Author:
welberge
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ProgrammingGuidelines

    v47 v48  
    290290  } 
    291291} 
     292}}} 
    292293Is less testable than this: 
     294{{{ 
    293295class Foo 
    294296{ 
     
    300302} 
    301303}}} 
    302 Because in the first case you cannot easily mock bar, which makes it hard to 
     304Because in the first case you cannot easily mock bar, which makes it hard to 
    303305test Foo in isolation. The second form is called dependency injection (you inject 
    304306the dependency to bar into the constructor). When using dependency injection, a convenience