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

Extraindo a regra de negócio para uma nova camada

Extraindo a regra de negócio para uma nova camada

Apresentado no Rails-MG em 2012

Gabriel Sobrinho

May 10, 2012
Tweet

More Decks by Gabriel Sobrinho

Other Decks in Programming

Transcript

  1. Contractus ~/Code (1.9.3-p0) 21:08:25 $ rails new contractus ... create

    app/controllers create app/models create app/views ...
  2. Contractus ~/Code (1.9.3-p0) 21:08:25 $ rails new contractus ... create

    app/controllers create app/models create app/views ...
  3. Contractus ~/Code (1.9.3-p0) 21:08:25 $ rails new contractus ... create

    app/controllers create app/models create app/views ...
  4. Contractus ~/Code (1.9.3-p0) 21:08:25 $ rails new contractus ... create

    app/controllers create app/models create app/views ...
  5. Contractus ~/Code (1.9.3-p0) 21:08:25 $ rails new contractus ... create

    app/controllers create app/models create app/views ...
  6. Contractus ~/Code (1.9.3-p0) 21:08:25 $ rails new contractus ... create

    app/controllers create app/models create app/views ...
  7. Contractus ~/Code (1.9.3-p0) 21:08:25 $ rails new contractus ... create

    app/controllers create app/models create app/views ...
  8. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  9. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  10. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  11. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  12. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  13. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  14. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  15. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  16. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  17. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  18. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  19. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  20. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  21. Contractus ~/Code/contractus (1.9.3-p0) (master) 21:10:52 $ rails generate scaffold contract

    name:string 21:21:49 $ rails generate scaffold item contract:references name:string price:decimal canceled_at:date
  22. ~/Code/contractus (1.9.3-p0) ((v0.1.0)) 07:28:35 $ time rspec spec/controllers ................................. Finished

    in 0.42347 seconds 33 examples, 0 failures real 0m7.831s user 0m3.328s sys 0m0.651s
  23. ~/Code/contractus (1.9.3-p0) ((v0.2.0)) 02:28:40 $ time rspec spec/models . Finished

    in 0.02556 seconds 1 example, 0 failures real 0m3.048s user 0m2.621s sys 0m0.413s
  24. ~/Code/contractus (1.9.3-p0) ((v0.3.0)) 02:29:59 $ time rspec spec/business . Finished

    in 0.00072 seconds 1 example, 0 failures real 0m0.535s user 0m0.397s sys 0m0.088s