~/talk

Inheritance, Composition, Ruby and You

Talkat RubyConf 2018 · 2018-11-28..11-30· [ruby]
links:none on file
slides:none on file

Argues that Ruby’s method lookup surprises (overriding puts, attr_reader order, Kernel removal) show why inheritance couples classes and complicates unit testing, with concrete ancestor lists and demo outputs. Shows composition via dependency injection via initializer (passing repo and API), small classes, and stubbed tests so behavior isolates and swaps. Recommends inheritance only for API base classes that share headers/error handling, warns Single Table Inheritance inherits the same pitfalls. Examples run and validate the claims.

AI-written summary · about

  1. 0:00Introduction to OOP
  2. 2:30Ruby method lookup
  3. 9:14Understanding inheritance
  4. 14:44Understanding composition
  5. 19:05Inheritance testing issues
  6. 22:03Composition testing benefits
  7. 24:20When to use inheritance
  8. 26:17Summary and Q&A
~/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.