Slide 1

Slide 1 text

Dependency Injection David Frame of 31interactive

Slide 2

Slide 2 text

?

Slide 3

Slide 3 text

Scenario #1 We need to be able to test our order class without sending any emails!

Slide 4

Slide 4 text

Dummy mailer class with a send() method that does nothing!

Slide 5

Slide 5 text

What is dependency injection?

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Single Responsibility Principle a class should have only a single responsibility Open / Closed Principle “software entities … should be open for extension, but closed for modification.” Liskov Substitution Principle Interface Segregation Principle Dependency Inversion Principle one should “Depend upon Abstractions. Do not depend upon concretions.”

Slide 8

Slide 8 text

Scenario #2 We need to store emails in the database so they can be queued up and sent at a later date!

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

Dependency Injection Containers

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Thanks for listening! Any questions? :) Email: [email protected] Twitter: @DaGrFr Review this talk at https://joind.in/16984