I don't think that you get the key point: Your mode switch indicates different behavior. Thus it is better to either use inheritance (strategy or template pattern) or DI. DI doesn't mean that the developer consuming this, must do it. Simply provide a factory which handles this.
No comments:
Post a Comment