Skip to content

Commit

Permalink
Add DI alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
damithc committed Sep 27, 2016
1 parent bee20e1 commit bed24e8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
Binary file modified doc/Diagrams.pptx
Binary file not shown.
4 changes: 4 additions & 0 deletions doc/LearningOutcomes.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ getting the `StorageFile` class involved? That is a situation where we can use *
* Update the `LogicTest` to work with the `StorageStub` instead of the actual `StorageFile` object. <br>
i.e. `Logic` injects a `StorageStub` object to replace the dependency of `Logic` on `Storage` before
testing `Logic`.
* The example above uses [DIP](#apply-dependency-inversion-principle-lo-dip) as a means to achieve DI.
Note that there is another way to inject a `StorageStub` object, as shown below.
In this case we do not apply the DIP but we still achieve DI.<br>
<img src="images/DependencyInjectionWithoutDIP.png" width="300">

------------------------------------------------------------------------------------------------------

Expand Down
Binary file added doc/images/DependencyInjectionWithoutDIP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/LogicStroageFileDIP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bed24e8

Please sign in to comment.