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

Tales from the dark side: Eight lessons from th...

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →

Tales from the dark side: Eight lessons from the Java world

A short talk given privately to engineers at work. Perhaps later I'll expand it.

Avatar for Michael Brodhead

Michael Brodhead

March 13, 2012

More Decks by Michael Brodhead

Other Decks in Programming

Transcript

  1. • • • • • • • • The client

    is inherently untrusted. account = Account(params[:account])
  2. • • • • • • • • Isolate dependencies.

    bundle install --path vendor/bundle
  3. • • • • • • • • Use real

    singletons. Logger.debug(“OHAI”)
  4. • • • • • • • • Use real

    singletons. class MyLogger include Singleton def debug(*args) # stuff end end class BokBok def initialize(logger) @logger = logger end def eat_corn @logger.debug("NOM") # do stuff end end logger = MyLogger.instance bokbok = BokBok.new(logger)
  5. • • • • • • • • You can

    get a long way with single inheritance