Approach 2: Pros and Cons

  • Pro: You could use an interface here
  • Con: Where does the logger instance come from?
  • You could construct it in ImportantProcessHandler
  • ... but then you're stuck with a specific type of logger
  • You could pass it in via the constructor
  • ... but then who constructs it?

25 / 27