Skip to content

Commit

Permalink
Merge pull request #113 from hronn13/master
Browse files Browse the repository at this point in the history
Update 8. Dependency Injection.md
  • Loading branch information
danielbsig committed Sep 6, 2015
2 parents e84cdb9 + b7c27c7 commit 2adf3bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Week02/8. Dependency Injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Advantages include:

1. If the the class is dependant on the dependency and will break without it, this way of injecting will make sure the class is not created without it.

2. Since the cunstructor is only called once, when the object is created, you can be sure that through the entire lifetime of the object, it will keep the same dependency. That is if you do not have some other methods to change the dependency.
2. Since the constructor is only called once, when the object is created, you can be sure that through the entire lifetime of the object, it will keep the same dependency. That is if you do not have some other methods to change the dependency.

On the other hand, the disadvantage is that if you need to extend the class and override the constructor you're going to run in to some trouble.

Expand Down

0 comments on commit 2adf3bd

Please sign in to comment.