SlideShare una empresa de Scribd logo
1 de 153
Descargar para leer sin conexión
Design Patterns + Ruby
@rs_felix

   http://github.com/fellix

  http://www.crafters.com.br
         @crafterstudio

http://blog.rollingwithcode.com
Por que Ruby?
1995
Erich Gamma, Richard Helm,
Raph Johnson, John Vlissides
“Gang of Four”
Design Patterns
Template Method
class Relatorio
 def generate
   output_head
   output_body
   output_footer
 end
 def output_head
 end
 def output_body
 end
 def output_footer
 end
end
class Relatorio
 def generate
   output_head
   output_body
   output_footer
 end
 def output_head
 end
 def output_body
 end
 def output_footer
 end
end
class Relatorio
 def generate
   output_head
                     Template
   output_body
                      Method
   output_footer
 end
 def output_head
 end
 def output_body
 end
 def output_footer
 end
end
class HTMLRelatorio < Relatorio
 def output_head
   puts "<html><head>
      <title>Relatório HTML</title>
      </head>"
 end
 def output_body
   puts "<body>...</body>"
 end
 def output_footer
   puts "</html>"
 end
end
class HTMLRelatorio < Relatorio
 def output_head
   puts "<html><head>
      <title>Relatório HTML</title>
      </head>"
 end
 def output_body
   puts "<body>...</body>"
 end
 def output_footer
   puts "</html>"
 end
end
class HTMLRelatorio < Relatorio
 def output_head
   puts "<html><head>
      <title>Relatório HTML</title>
      </head>"
 end
 def output_body
   puts "<body>...</body>"
 end
 def output_footer
   puts "</html>"
 end
end
relatorio = HTMLRelatorio.new
relatorio.generate
relatorio = HTMLRelatorio.new
relatorio.generate
class Relatorio
                          def generate
relatorio = HTMLRelatorio.new
                            output_head
relatorio.generate
                            output_body
                            output_footer
                          end
                         end
<html>
 <head><title>...</title></head>
      relatorio = HTMLRelatorio.new
 <body>
      relatorio.generate
  ...
 </body>
</html>
Strategy
Delegar ao invés de herdar
class Formatter
 def format(text)

 end
end
class Formatter
 def format(text)
   raise "Abstract method"
 end
end
class HTMLFormatter < Formatter
 def format(text)
  puts "<html> "
  puts "<head> "
  puts "<title>...</title></head> "
  puts "<body>#{text}</body></html>"
 end
end
class HTMLFormatter < Formatter
 def format(text)
  puts "<html> "
  puts "<head> "
  puts "<title>...</title></head> "
  puts "<body>#{text}</body></html>"
 end
end
class HTMLFormatter
 def format(text)
  puts "<html> "
  puts "<head> "
  puts "<title>...</title></head> "
  puts "<body>#{text}</body></html>"
 end
end
Duck Typing
class HTMLFormatter
 def format(text)
  puts "<html> "
  puts "<head> "
  puts "<title>...</title></head> "
  puts "<body>#{text}</body></html>"
 end
end
class Relatorio
 def initialize(formatter)
   @formatter = formatter
 end
 def generate(text)
   @formatter.format(text)
 end
end
class Relatorio
 def initialize(formatter)
   @formatter = formatter
 end
 def generate(text)
   @formatter.format(text)
 end
end
class Relatorio
 def initialize(formatter)
   @formatter = formatter
 end
 def generate(text)
   @formatter.format(text)
 end
end
class Relatorio
 def initialize(formatter)
   @formatter = formatter    Delegate
 end
 def generate(text)
   @formatter.format(text)
 end
end
relatorio = Relatorio.new(HTMLFormatter.new)
relatorio.generate("Muitas e muitas coisas")
relatorio = Relatorio.new(HTMLFormatter.new)
relatorio.generate("Muitas e muitas coisas")
relatorio = Relatorio.new(HTMLFormatter.new)
relatorio.generate("Muitas e muitas coisas")
Observer
Manter-se informado sobre determinadas mudanças em
                      objetos
class NotaFiscal
 def pagar
   ...
 end
end
class FluxoCaixa
 def atualizar
   ...
 end
end
Consulta no banco
class FluxoCaixa
                 de dados todas as
 def atualizar
                   notas pagas e
   ...
                 atualiza o fluxo de
 end
                        caixa
end
pagar

NotaFiscal           FluxoCaixa
class NotaFiscal
 def pagar
   ...
 end
end
class NotaFiscal
 def pagar (fluxo)
   ...
   fluxo.atualizar
 end
end
class NotaFiscal
  def initialize (...)
   ...
   @observers = []
 end
 def pagar
   ...
 end
end
class NotaFiscal
  def add_observer (observer)
   @observers << observer
 end
 def notify_observers
   @observers.each do |o|
     o.update(self)
   end
 end
end
class FluxoCaixa
 def atualizar
   ...
 end
 def update (nota_fiscal)
   ...
 end
end
fluxo_caixa = FluxoCaixa.new
nota_fiscal = NotaFiscal.new
nota_fiscal.add_observer fluxo_caixa

nota_fiscal.pagar
require "observer"
class NotaFiscal
  include Observable

 def pagar
   ...
   changed
   notify_observers(self)
 end
end
require "observer"
class NotaFiscal
  include Observable

 def pagar
   ...
   changed
   notify_observers(self)
 end
end
require "observer"
class NotaFiscal
  include Observable

 def pagar
   ...
   changed
   notify_observers(self)
 end
end
require "observer"
class NotaFiscal
  include Observable

 def pagar
   ...
   changed
   notify_observers(self)
 end
end
require "observer"
class NotaFiscal
  include Observable

 def pagar       @changed = true
   ...
   changed
   notify_observers(self)
 end
end
require "observer"
            class NotaFiscal
              include Observable

@observers.each { pagar
             def |o| o.update(object) } if @changed
               ...
               changed
               notify_observers(self)
             end
            end
class FluxoCaixa
 def atualizar
   ...
 end
 def update (nota_fiscal)
   ...
 end
end
fluxo_caixa = FluxoCaixa.new
nota_fiscal = NotaFiscal.new
nota_fiscal.add_observer fluxo_caixa

nota_fiscal.pagar
notifica

nota_fiscal
     fluxo_caixa = FluxoCaixa.new      fluxo_caixa
      nota_fiscal = NotaFiscal.new
      nota_fiscal.add_observer fluxo_caixa

      nota_fiscal.pagar
Factory
Fornecer uma interface para a criação de objetos, sem
           especificar a classe concreta
HTMLReader.new
PDFReader.new
class ReaderFactory
 def initialize (format)
   @reader_class =
     self.class.const_get("#{format}Reader")
 end
 def reader
   @reader_class.new
 end
end
class ReaderFactory
 def initialize (format)
   @reader_class =
     self.class.const_get("#{format}Reader")
 end
 def reader
   @reader_class.new
 end
end
class ReaderFactory
 def initialize (format)
   @reader_class =
     self.class.const_get("#{format}Reader")
 end
 def reader
   @reader_class.new
 end
end
class ReaderFactory
 def initialize (format)
   @reader_class =
     self.class.const_get("#{format}Reader")
 end
 def reader
   @reader_class.new
 end
end
html_reader = ReaderFactory.new("HTML").reader
pdf_reader = ReaderFactory.new("PDF").reader
class ReaderFactory
 def self.pdf_reader
   ReaderFactory.new("PDF").reader
 end
 def self.html_reader
   ReaderFactory.new("HTML").reader
 end
end
html_reader = ReaderFactory.html_reader
Active Record Factory
class Base
  ...
end
class Base
  def self.mysql_connection
    ...
   end
end
class Base
  def self.postgresql_connection
    ...
   end
end
adapter = "mysql"
method_name = "#{adapter}_connection"
Base.send(method_name, config)
Builder
Criar objetos complexos de forma legível, passo a passo
class Pizza
  attr_accessor :massa, :molho, :cobertura
end
class PizzaBuilder
  attr_reader :pizza
  def initialize
    @pizza = Pizza.new
  end
end
class CalabresaBuilder < PizzaBuilder
  def molho
    @pizza.molho = "Tomate"
  end
  def massa
    @pizza.massa = "Pão"
  end
 def cobertura
    @pizza.cobertura = "queijo, calabresa"
  end
end
builder = CalabresaBuilder.new
builder.molho
builder.cobertura
builder.massa
pizza = builder.pizza
pizza = CalabresaBuilder.new
 .molho
 .cobertura
 .massa
 .pizza
class CalabresaBuilder < PizzaBuilder
  def molho
    @pizza.molho = "Tomate"
   self
  end
  def massa
    @pizza.massa = "Pão"
   self
  end
 def cobertura
    @pizza.cobertura = "queijo, calabresa"
   self
  end
end
builder = CalabresaBuilder.new
builder.molho_and_cobertura
pizza = builder.pizza
class PizzaBuilder
  def method_missing(name, *args)
    methods = name.to_s.split("_")
   return super(name, *args) unless
   methods[1] == "and"

   methods.each do |method|
    next if method == "and"
    send(method)
   end

 end
end
builder.molho_and_cobertura
builder.massa_and_cobertura
builder.molho_and_cobertura_and_massa
Adapter
Conectar objetos que não tem uma interface comum
class Padrao1
 def conectar (cabo)
   cabo.energizar
 end
end
class Padrao1
 def conectar (cabo)
   cabo.energizar
 end
end
class CaboPadrao1
 def energizar
   ...
 end
end
class Padrao2
 def conectar (cabo)
   cabo.executar
 end
end
class Padrao2
 def conectar (cabo)
   cabo.executar
 end
end
class CaboPadrao2
 def executar
   ...
 end
end
class CaboPadrao2
 def executar
   ...
 end
end
class CaboPadrao2
 def executar
               tomada = Padrao2.new
   ...
               tomada.conectar
 end
                  CaboPadrao2.new
end
class CaboPadrao2
 def executar
               tomada = Padrao1.new
   ...
               tomada.conectar
 end
                  CaboPadrao2.new
end
class CaboPadrao2
 def executar
               tomada = Padrao1.new
   ...
               tomada.conectar
 end
                  CaboPadrao2.new
end
class AdapterPadrao2
 def initialize(cabo_padrao2)
   @cabo = cabo_padrao2
 end
 def energizar
   @cabo.executar
 end
end
class AdapterPadrao2
 def initialize(cabo_padrao2)
   @cabo = cabo_padrao2
 end
 def energizar
   @cabo.executar
 end
end
class AdapterPadrao2
 def initialize(cabo_padrao2)
   @cabo = cabo_padrao2
 end
 def energizar
   @cabo.executar
 end
end
adapter = AdapterPadrao2.new(CaboPadrao2.new)
tomada = Padrao1.new
tomada.conectar(adapter)
adapter = AdapterPadrao2.new(CaboPadrao2.new)
tomada = Padrao1.new
tomada.conectar(adapter)
tomada           adapter            cabo
adapter = AdapterPadrao2.new(CaboPadrao2.new)
tomada = Padrao1.new
tomada.conectar(adapter)
Proxy
class ContaBancaria
 def initialize(saldo)
   @saldo = saldo
 end
 def depositar!(valor)
   @saldo += valor
 end
 def sacar!(valor)
   @saldo -= valor
 end
 def some_method
 end
end
class ContaBancariaProxy
 def initialize(conta_bancaria)
   @conta_bancaria = conta_bancaria
 end
 def depositar!(valor)
   @conta_bancaria.depositar! valor
 end
 def sacar!(valor)
   @conta_bancaria .sacar! valor
 end
end
Protection Proxy
class ContaBancariaProxy
 def initialize(conta_bancaria)
   @conta_bancaria = conta_bancaria
 end
 def depositar!(valor)
   @conta_bancaria.depositar! valor
 end
 def sacar!(valor)
   @conta_bancaria .sacar! valor
 end
end
class ContaBancariaProxy
 def initialize(conta_bancaria, owner)
   @conta_bancaria = conta_bancaria
   @owner = owner
 end

 protected
  def check_access
   raise "Illegal Access" unless User. login
   == @owner
  end
end
class ContaBancariaProxy
 def depositar!(valor)
   check_access
   @conta_bancaria.depositar! valor
 end
 def sacar!(valor)
    check_access
   @conta_bancaria .sacar! valor
 end
end
Decorator
class Coffee
  def price
   @price
  end
 def ingredients
   @ingredients
  end
end
class MilkDecorator
 def initialize (coffee)
    @coffee = coffee
  end
  def price
    coffee.price + 0.5
   end
 def ingredients
    coffee.ingredients + ", Leite"
  end
end
class MilkDecorator
 def initialize (coffee)
    @coffee = coffee
  end
  def price
    coffee.price + 0.5
   end
 def ingredients
    coffee.ingredients + ", Leite"
  end
end
class MilkDecorator
 def initialize (coffee)
    @coffee = coffee
  end
  def price
    coffee.price + 0.5
   end
 def ingredients
    coffee.ingredients + ", Leite"
  end
end
class MilkDecorator
 def initialize (coffee)
    @coffee = coffee
  end
  def price
    coffee.price + 0.5
   end
 def ingredients
    coffee.ingredients + ", Leite"
  end
end
coffee = Coffee.new(1.5, "Café, Água")
puts coffee.ingredients
coffee = Coffee.new(1.5, "Café, Água")
puts coffee.ingredients       Café, Água
coffee = Coffee.new(1.5, "Café, Água")
coffee = MilkDecorator.new coffee
puts coffee.ingredients
puts coffee.price
coffee = Coffee.new(1.5, "Café, Água")
coffee = MilkDecorator.new coffee
puts coffee.ingredients     Café, Água, Leite
puts coffee.price
coffee = Coffee.new(1.5, "Café, Água")
coffee = MilkDecorator.new coffee
puts coffee.ingredients
puts coffee.price            2.0
class ChocolateDecorator
 def initialize (coffee)
    @coffee = coffee
  end
  def price
    coffee.price + 1.0
   end
 def ingredients
    coffee.ingredients + ", Chocolate"
  end
end
coffee = Coffee.new(1.5, "Café, Água")
coffee = ChocolateDecorator.new coffee
puts coffee.ingredients
coffee = Coffee.new(1.5, "Café, Água")
coffee = ChocolateDecorator.new coffee
                                Café, Água,
puts coffee.ingredients          Chocolate
coffee = Coffee.new(1.5, "Café, Água")
coffee = ChocolateDecorator.new coffee
puts coffee.ingredients
coffee = Coffee.new(1.5, "Café, Água")
coffee = ChocolateDecorator.new coffee
coffee = Coffee.new(1.5, "Café, Água")
coffee = ChocolateDecorator.new coffee
coffee = MilkDecorator.new coffee
coffee = Coffee.new(1.5, "Café, Água")
coffee = ChocolateDecorator.new coffee
coffee = MilkDecorator.new coffee
                                Café, Água,
puts coffee.ingredients
                             Chocolate, Leite
Singleton
Garantir que só haja uma instancia de determinado objeto
@count
@count
@@count
class CountTester
 @@count = 0
  def initialize
   @count = 0
  end
  def self.increment
   @@count++
  end
  def increment
   @count++
  end
end
class CountTester
                       Variável
 @@count = 0
                        Global
  def initialize
   @count = 0
  end
  def self.increment
   @@count++
  end
  def increment
   @count++
  end
end
class CountTester
 @@count = 0
  def initialize
                       Variável
   @count = 0
                        Local
  end
  def self.increment
   @@count++
  end
  def increment
   @count++
  end
end
class CountTester
 @@count = 0
  def initialize
   @count = 0
  end
                       Metódo
  def self.increment
                       Estático
   @@count++
  end
  def increment
   @count++
  end
end
class CountTester
 @@count = 0
  def initialize
   @count = 0
  end
  def self.increment
   @@count++
  end
                       Metódo de
  def increment
                       Instância
   @count++
  end
end
class CountTester
                    Variável
 COUNT = 0
                     Global
end
class Logger
 @@instance = Logger.new

 def self.instance
   @@instance
 end
end
logger1 = Logger.instance
logger2 = Logger.instance
logger = Logger.new
class Logger
 @@instance = Logger.new

 def self.instance
   @@instance
 end



end
class Logger
 @@instance = Logger.new

 def self.instance
   @@instance
 end

 private_class_method :new
end
require "singleton"
class Logger
   include Singleton
end
logger = Logger.new
logger = Logger.new


            private method ‘new’
           called for Logger::Class
logger = Logger.instance
Obrigado
          @rs_felix

   http://github.com/fellix

  http://www.crafters.com.br
         @crafterstudio

http://blog.rollingwithcode.com

Más contenido relacionado

La actualidad más candente

Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0Eyal Vardi
 
Angular 2.0 Views
Angular 2.0 ViewsAngular 2.0 Views
Angular 2.0 ViewsEyal Vardi
 
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Colin O'Dell
 
50 Laravel Tricks in 50 Minutes
50 Laravel Tricks in 50 Minutes50 Laravel Tricks in 50 Minutes
50 Laravel Tricks in 50 MinutesAzim Kurt
 
Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015Konstantin Kudryashov
 
Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片cfc
 
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPresswpnepal
 
Introduction to Zend Framework web services
Introduction to Zend Framework web servicesIntroduction to Zend Framework web services
Introduction to Zend Framework web servicesMichelangelo van Dam
 
RichFaces: more concepts and features
RichFaces: more concepts and featuresRichFaces: more concepts and features
RichFaces: more concepts and featuresMax Katz
 
Angular 2 Architecture
Angular 2 ArchitectureAngular 2 Architecture
Angular 2 ArchitectureEyal Vardi
 
Introduction to ReasonML
Introduction to ReasonMLIntroduction to ReasonML
Introduction to ReasonMLRiza Fahmi
 
Perkenalan ReasonML
Perkenalan ReasonMLPerkenalan ReasonML
Perkenalan ReasonMLRiza Fahmi
 
Angular.js Fundamentals
Angular.js FundamentalsAngular.js Fundamentals
Angular.js FundamentalsMark
 
06 jQuery #burningkeyboards
06 jQuery  #burningkeyboards06 jQuery  #burningkeyboards
06 jQuery #burningkeyboardsDenis Ristic
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICKonstantin Kudryashov
 
Cloud Entwicklung mit Apex
Cloud Entwicklung mit ApexCloud Entwicklung mit Apex
Cloud Entwicklung mit ApexAptly GmbH
 

La actualidad más candente (20)

Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
 
Javascript
JavascriptJavascript
Javascript
 
Angular 2.0 Views
Angular 2.0 ViewsAngular 2.0 Views
Angular 2.0 Views
 
Advanced Django
Advanced DjangoAdvanced Django
Advanced Django
 
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016
 
50 Laravel Tricks in 50 Minutes
50 Laravel Tricks in 50 Minutes50 Laravel Tricks in 50 Minutes
50 Laravel Tricks in 50 Minutes
 
Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015
 
Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片
 
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPress
 
Min-Maxing Software Costs
Min-Maxing Software CostsMin-Maxing Software Costs
Min-Maxing Software Costs
 
Introduction to Zend Framework web services
Introduction to Zend Framework web servicesIntroduction to Zend Framework web services
Introduction to Zend Framework web services
 
RichFaces: more concepts and features
RichFaces: more concepts and featuresRichFaces: more concepts and features
RichFaces: more concepts and features
 
Angular 2 Architecture
Angular 2 ArchitectureAngular 2 Architecture
Angular 2 Architecture
 
Introduction to ReasonML
Introduction to ReasonMLIntroduction to ReasonML
Introduction to ReasonML
 
Perkenalan ReasonML
Perkenalan ReasonMLPerkenalan ReasonML
Perkenalan ReasonML
 
Angular.js Fundamentals
Angular.js FundamentalsAngular.js Fundamentals
Angular.js Fundamentals
 
06 jQuery #burningkeyboards
06 jQuery  #burningkeyboards06 jQuery  #burningkeyboards
06 jQuery #burningkeyboards
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
 
Cloud Entwicklung mit Apex
Cloud Entwicklung mit ApexCloud Entwicklung mit Apex
Cloud Entwicklung mit Apex
 
Mocking Demystified
Mocking DemystifiedMocking Demystified
Mocking Demystified
 

Similar a Ruby - Design patterns tdc2011

Decent exposure: Controladores sin @ivars
Decent exposure: Controladores sin @ivarsDecent exposure: Controladores sin @ivars
Decent exposure: Controladores sin @ivarsLeonardo Soto
 
Como programar un blog REST
Como programar un blog RESTComo programar un blog REST
Como programar un blog RESTJavier Vidal
 
Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!Fabio Kung
 
Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11Pedro Cunha
 
Metaprogramming + Ds Ls
Metaprogramming + Ds LsMetaprogramming + Ds Ls
Metaprogramming + Ds LsArrrrCamp
 
Código Saudável => Programador Feliz - Rs on Rails 2010
Código Saudável => Programador Feliz - Rs on Rails 2010Código Saudável => Programador Feliz - Rs on Rails 2010
Código Saudável => Programador Feliz - Rs on Rails 2010Plataformatec
 
Metaprogramovanie #1
Metaprogramovanie #1Metaprogramovanie #1
Metaprogramovanie #1Jano Suchal
 
TDC 2012 - Patterns e Anti-Patterns em Ruby
TDC 2012 - Patterns e Anti-Patterns em RubyTDC 2012 - Patterns e Anti-Patterns em Ruby
TDC 2012 - Patterns e Anti-Patterns em RubyFabio Akita
 
G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門Tsuyoshi Yamamoto
 
Idoc script beginner guide
Idoc script beginner guide Idoc script beginner guide
Idoc script beginner guide Vinay Kumar
 
Postobjektové programovanie v Ruby
Postobjektové programovanie v RubyPostobjektové programovanie v Ruby
Postobjektové programovanie v RubyJano Suchal
 
Attributes Unwrapped: Lessons under the surface of active record
Attributes Unwrapped: Lessons under the surface of active recordAttributes Unwrapped: Lessons under the surface of active record
Attributes Unwrapped: Lessons under the surface of active record.toster
 
GLRB - Decent exposure
GLRB - Decent exposureGLRB - Decent exposure
GLRB - Decent exposureMatt Yoho
 
Blocks by Lachs Cox
Blocks by Lachs CoxBlocks by Lachs Cox
Blocks by Lachs Coxlachie
 
Say Goodbye to Procedural Programming - Nick Sutterer
Say Goodbye to Procedural Programming - Nick SuttererSay Goodbye to Procedural Programming - Nick Sutterer
Say Goodbye to Procedural Programming - Nick SuttererRuby Meditation
 

Similar a Ruby - Design patterns tdc2011 (20)

Decent exposure: Controladores sin @ivars
Decent exposure: Controladores sin @ivarsDecent exposure: Controladores sin @ivars
Decent exposure: Controladores sin @ivars
 
Como programar un blog REST
Como programar un blog RESTComo programar un blog REST
Como programar un blog REST
 
Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!
 
Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11
 
Metaprogramming + Ds Ls
Metaprogramming + Ds LsMetaprogramming + Ds Ls
Metaprogramming + Ds Ls
 
Código Saudável => Programador Feliz - Rs on Rails 2010
Código Saudável => Programador Feliz - Rs on Rails 2010Código Saudável => Programador Feliz - Rs on Rails 2010
Código Saudável => Programador Feliz - Rs on Rails 2010
 
Metaprogramovanie #1
Metaprogramovanie #1Metaprogramovanie #1
Metaprogramovanie #1
 
Ruby
RubyRuby
Ruby
 
TDC 2012 - Patterns e Anti-Patterns em Ruby
TDC 2012 - Patterns e Anti-Patterns em RubyTDC 2012 - Patterns e Anti-Patterns em Ruby
TDC 2012 - Patterns e Anti-Patterns em Ruby
 
G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門
 
Idoc script beginner guide
Idoc script beginner guide Idoc script beginner guide
Idoc script beginner guide
 
Postobjektové programovanie v Ruby
Postobjektové programovanie v RubyPostobjektové programovanie v Ruby
Postobjektové programovanie v Ruby
 
Attributes Unwrapped: Lessons under the surface of active record
Attributes Unwrapped: Lessons under the surface of active recordAttributes Unwrapped: Lessons under the surface of active record
Attributes Unwrapped: Lessons under the surface of active record
 
Dsl
DslDsl
Dsl
 
GLRB - Decent exposure
GLRB - Decent exposureGLRB - Decent exposure
GLRB - Decent exposure
 
Having Fun Programming!
Having Fun Programming!Having Fun Programming!
Having Fun Programming!
 
PHPSpec BDD for PHP
PHPSpec BDD for PHPPHPSpec BDD for PHP
PHPSpec BDD for PHP
 
Blocks by Lachs Cox
Blocks by Lachs CoxBlocks by Lachs Cox
Blocks by Lachs Cox
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Say Goodbye to Procedural Programming - Nick Sutterer
Say Goodbye to Procedural Programming - Nick SuttererSay Goodbye to Procedural Programming - Nick Sutterer
Say Goodbye to Procedural Programming - Nick Sutterer
 

Último

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Ruby - Design patterns tdc2011