Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SOLID - Dependency inversion principle

Avatar for Amanda Amanda
October 09, 2018

SOLID - Dependency inversion principle

Avatar for Amanda

Amanda

October 09, 2018
Tweet

More Decks by Amanda

Other Decks in Technology

Transcript

  1. Fragilidade "Tendência do software de quebrar em vários lugares sempre

    que é alterado. Geralmente em lugares não relacionados conceitualmente com o local da mudança."
  2. Rigidez "Tendência do software de ser difícil de mudar. Qualquer

    mudança gera várias mudanças em sequência." https://fi.ort.edu.uy/innovaportal/file/2032/1/design_principles.pdf
  3. class Copier def self.copy reader = KeyboardReader.new writer = Printer.new

    keystrokes = reader.read_until_eof writer.write(keystrokes) end end
  4. class Copier def initialize(reader, writer) @reader = reader @writer =

    writer end def copy @writer.write(@reader.read_until_eof) end end