~/talk

Dependency Injection

Talkat Rocky Mountain Ruby 2012 · 2012-09-19..09-21· [software-architecture]
links:none on file
slides:none on file

Argues that Ruby benefits from explicit dependency injection contrary to common advice and ships a tiny DI framework built on the method_decorator gem that uses provides/requires annotations to auto-instantiate dependencies. Example builds a happy service that gets a weather service (which itself uses a location service), enabling unit tests by swapping in mock weather objects. It works for testability but trades clarity — dependencies appear magically — and requires each class to define initialize and extend a service provider.

AI-written summary · about

  1. 0:00What is dependency injection
  2. 0:28HappyService
  3. 0:45Testing HappyService
  4. 1:00Testing WeatherService
  5. 1:22Dependency Injection
  6. 1:53Method Decorator
  7. 3:20Testing
  8. 3:43Disadvantages
  9. 4:15Outro
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.