Adaptação da minha palestra na InfoQ e na Campus Party para o grupo .Net Architects que se encontra na Unip. http://www.dotnetarchitects.net/ Foi muito legal.
8. “Without understanding functional programming, you can't
invent MapReduce, the algorithm that makes Google so
massively scalable.”
“The Perils of JavaSchools” - Joel Spolsky - 29/12/2005
http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html
9. “The terms Map and Reduce come from Lisp and
functional programming...”
“The Perils of JavaSchools” - Joel Spolsky - 29/12/2005
http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html
10. “The very fact that Google invented MapReduce, and
Microsoft didn't, says something about why Microsoft is
still playing catch up.”
“The Perils of JavaSchools” - Joel Spolsky - 29/12/2005
http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html
59. RSpec
describe Product do
include ProductSpecHelper
before(:each) do
@product = Product.new
end
it quot;should not be valid when emptyquot; do
@product.should_not be_valid
end
it quot;should be valid when having correct informationquot; do
@product.attributes = valid_product_attributes
@product.should be_valid
end
end
60. RSpec
describe Product do
include ProductSpecHelper
before(:each) do
@product = Product.new
end
it quot;should not be valid when emptyquot; do
rake spec
@product.should_not be_valid
end
it quot;should be valid when having correct informationquot; do
@product.attributes = valid_product_attributes
@product.should be_valid
end
end
67. Rotas RESTFul
ActionController::Routing::Routes.draw do |map|
map.connect ':controller/service.wsdl', :action => 'wsdl'
map.resources :products,
:member => {:change_image => :post}
map.resources :addresses
map.resources :orders,
:has_many => [:line_items]
map.namespace :admin do |admin|
admin.resources :users
admin.resources :products
end
end
68. Rotas RESTFul
ActionController::Routing::Routes.draw do |map|
GET /products/new
map.connect ':controller/service.wsdl', :action => 'wsdl'
GET /products
map.resources :products,
POST /products
:member => {:change_image => :post}
map.resources :addresses
GET /products/1
map.resources :orders,
GET /products/1/edit
:has_many => [:line_items]
map.namespace PUT /products/1
:admin do |admin|
DESTROY /products/1
admin.resources :users
admin.resources :products
end
end
69. Migrations
class RenameAppConfiguration < ActiveRecord::Migration
def self.up
rename_table :app_configurations, :configurations
change_table :configurations do |t|
t.string :type
end
end
def self.down
change_table :configurations do |t|
t.remove :type
end
rename_table :configurations, :app_configurations
end
end
70. Migrations
class RenameAppConfiguration < ActiveRecord::Migration
def self.up
rename_table :app_configurations, :configurations
change_table :configurations do |t|
t.string :type
end
rake db:migrate
end
def self.down
change_table :configurations do |t|
t.remove :type
end
rename_table :configurations, :app_configurations
end
end
76. 11 mil classes!
46 só de
Collections!
http://weblog.jamisbuck.org/2008/11/9/legos-play-doh-and-programming
http://weblog.jamisbuck.org/2008/11/29/recovering-from-enterprise-video-available
85. To put things into
perspective, though,
Friendster was written in Java
to start, and switched to
PHP. Myspace was written in
ColdFusion and transitioned
to ASP.NET.
When people run into
problems scaling sites they
often think that the language
is the problem, but I think it’s
Blaine Cook
rarely the case.
http://www.akitaonrails.com/2008/6/17/chatting-with-blaine-cook-twitter
http://www.akitaonrails.com/2008/6/17/chatting-with-blaine-cook-twitter
86. “The New York Times used Ruby on Rails to pull
together, analyze and display election results in
near real time on one of its busiest Web
traffic days ever. ”
http://www.computerworld.com.au/article/268003/ruby_rails_rolls_into_enterprise?fp=16&fpid=1
http://www.computerworld.com/action/article.do?
command=viewArticleBasic&articleId=9120778
87. “They serve up 23 million visitors a month. The conversion resulted in 20,000 lines
of Ruby code instead of 125,000 lines of Java code, and most importantly eased
the difficulty they had in maintaining it. Once complete, and optimized their site
is now faster than before. They also completed the rewrite in three months with
four developers.”
http://www.railsonwave.com/railsonwave/2008/6/4/yellowpages-com-migrates-to-rails
http://www.akitaonrails.com/2008/11/21/rails-podcast-brasil-qcon-special-john-straw-
yellowpages-com-and-matt-aimonetti-merb
http://www.rubyonrailsexamples.com/sites-on-rails/yellowpagescom-goes-ror/