Ceara On Rails 2009
Upcoming SlideShare
Loading in...5
×
 

Ceara On Rails 2009

on

  • 1,148 views

Ruby on Rails e Agilidade no Ceará, dia 7/nov.

Ruby on Rails e Agilidade no Ceará, dia 7/nov.

Statistics

Views

Total Views
1,148
Views on SlideShare
1,147
Embed Views
1

Actions

Likes
0
Downloads
8
Comments
0

1 Embed 1

http://www.slideshare.net 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Ceara On Rails 2009 Ceara On Rails 2009 Presentation Transcript

  • Tuesday, December 15, 2009
  • Filoso a Ruby on Rails Tuesday, December 15, 2009
  • AkitaOnRails.com Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • www.slideshare.net/akitaonrails fabio.akita@locaweb.com.br Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Ruby on Rails 2.3 Ruby 1.8 “Novo” Ruby 1.9 Tuesday, December 15, 2009
  • Ruby on Rails 2.3 Ruby 1.8 “Novo” Ruby 1.9 Tuesday, December 15, 2009
  • Ruby on Rails 2.3 Ruby 1.8 “Novo” Ruby 1.9 Tuesday, December 15, 2009
  • “Matz” 1993 Tuesday, December 15, 2009
  • “Prag Dave” 2001 Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Orientação a Objetos? Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Alan Kay Dan Ingalls Tuesday, December 15, 2009
  • Alan Kay Eu inventei o termo ‘orientação a objetos’, e posso lhes dizer que não estava pensando em C++ Tuesday, December 15, 2009
  • Meta-programação Tuesday, December 15, 2009
  • Sim, faz praticamente tudo Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Demo Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Charles Nutter 2006 Tuesday, December 15, 2009
  • “DHH” 2004 Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Ruby on Rails Tuesday, December 15, 2009
  • Código que gera Código Convention over Con guration Extreme Programming Tuesday, December 15, 2009
  • Código que gera Código Convention over Con guration Extreme Programming Tuesday, December 15, 2009
  • Código que gera Código Convention over Con guration Extreme Programming Tuesday, December 15, 2009
  • Restful Resources Unicode, Time Zone, i18n Segurança (XSS, CSRF, Injection) Suporte a vários bancos de dados Envio/Recebimento de e-mails Tuesday, December 15, 2009
  • Restful Resources Unicode, Time Zone, i18n Segurança (XSS, CSRF, Injection) Suporte a vários bancos de dados Envio/Recebimento de e-mails Tuesday, December 15, 2009
  • Restful Resources Unicode, Time Zone, i18n Segurança (XSS, CSRF, Injection) Suporte a vários bancos de dados Envio/Recebimento de e-mails Tuesday, December 15, 2009
  • Restful Resources Unicode, Time Zone, i18n Segurança (XSS, CSRF, Injection) Suporte a vários bancos de dados Envio/Recebimento de e-mails Tuesday, December 15, 2009
  • Restful Resources Unicode, Time Zone, i18n Segurança (XSS, CSRF, Injection) Suporte a vários bancos de dados Envio/Recebimento de e-mails Tuesday, December 15, 2009
  • gem install rails Tuesday, December 15, 2009
  • “Beautiful Code” Tuesday, December 15, 2009
  • @Transient public BigDecimal getTotal() //$Id: Booking.java 5579 2007-06-27 00:06:49Z gavin $ { package org.jboss.seam.example.booking; return hotel.getPrice().multiply( new BigDecimal( getNights() ) ); } import java.io.Serializable; import java.math.BigDecimal; @Transient import java.text.DateFormat; public int getNights() import java.util.Date; { return (int) ( checkoutDate.getTime() - checkinDate.getTime() ) / import javax.persistence.Basic; 1000 / 60 / 60 / 24; import javax.persistence.Entity; } import javax.persistence.GeneratedValue; import javax.persistence.Id; @Id @GeneratedValue import javax.persistence.ManyToOne; public Long getId() import javax.persistence.Temporal; { import javax.persistence.TemporalType; return id; import javax.persistence.Transient; } public void setId(Long id) import org.hibernate.validator.Length; { import org.hibernate.validator.NotNull; this.id = id; import org.hibernate.validator.Pattern; } import org.jboss.seam.annotations.Name; @NotNull @Entity @Basic @Temporal(TemporalType.DATE) @Name("booking") public Date getCheckinDate() public class Booking implements Serializable { { return checkinDate; private Long id; } private User user; public void setCheckinDate(Date datetime) private Hotel hotel; { private Date checkinDate; this.checkinDate = datetime; private Date checkoutDate; } private String creditCard; private String creditCardName; @ManyToOne @NotNull private int creditCardExpiryMonth; public Hotel getHotel() private int creditCardExpiryYear; { private boolean smoking; return hotel; private int beds; } public void setHotel(Hotel hotel) public Booking() {} { this.hotel = hotel; public Booking(Hotel hotel, User user) } { this.hotel = hotel; @ManyToOne @NotNull this.user = user; public User getUser() } { return user; } Tuesday, December 15, 2009
  • public int getBeds() public void setUser(User user) { { return beds; this.user = user; } } public void setBeds(int beds) @Basic @Temporal(TemporalType.DATE) { @NotNull this.beds = beds; public Date getCheckoutDate() } { @NotNull(message="Credit card name is required") return checkoutDate; @Length(min=3, max=70, message="Credit card name is required") } public String getCreditCardName() public void setCheckoutDate(Date checkoutDate) { { return creditCardName; this.checkoutDate = checkoutDate; } } public void setCreditCardName(String creditCardName) @NotNull(message="Credit card number is required") { @Length(min=16, max=16, message="Credit card number must 16 digits long") this.creditCardName = creditCardName; @Pattern(regex="^d*$", message="Credit card number must be numeric") } public String getCreditCard() { public int getCreditCardExpiryMonth() return creditCard; { } return creditCardExpiryMonth; } public void setCreditCard(String creditCard) { public void setCreditCardExpiryMonth(int creditCardExpiryMonth) this.creditCard = creditCard; { } this.creditCardExpiryMonth = creditCardExpiryMonth; } @Transient public String getDescription() public int getCreditCardExpiryYear() { { DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM); return creditCardExpiryYear; return hotel==null ? null : hotel.getName() + } ", " + df.format( getCheckinDate() ) + " to " + df.format( getCheckoutDate() ); public void setCreditCardExpiryYear(int creditCardExpiryYear) } { this.creditCardExpiryYear = creditCardExpiryYear; public boolean isSmoking() } { return smoking; @Override } public String toString() { public void setSmoking(boolean smoking) return "Booking(" + user + ","+ hotel + ")"; { } this.smoking = smoking; } } Tuesday, December 15, 2009
  • class Booking < ActiveRecord::Base belongs_to :hotel belongs_to :user validates_presence_of :hotel validates_presence_of :user validates_presence_of :credit_card validates_presence_of :credit_card_name validates_length_of :credit_card, :within => 16..16 validates_format_of :credit_card, :with => /^d*$/ validates_length_of :credit_card_name, :within => 3..70 def total hotel.price * nights end def nights ((checkout_date - checkin_date) / 1.day).round end def to_s "Booking(#{user},#{hotel})" end end Tuesday, December 15, 2009
  • class Booking < ActiveRecord::Base belongs_to :hotel belongs_to :user validates_presence_of :hotel validates_presence_of :user validates_presence_of :credit_card validates_presence_of :credit_card_name validates_length_of :credit_card, :within => 16..16 validates_format_of :credit_card, :with => /^d*$/ validates_length_of :credit_card_name, :within => 3..70 def total hotel.price * nights end def nights ((checkout_date - checkin_date) / 1.day).round end def to_s "Booking(#{user},#{hotel})" end end Tuesday, December 15, 2009
  • class CreateBookings < ActiveRecord::Migration def self.up create_table :bookings do |t| t.references :user t.references :hotel t.datetime :checkin t.datetime :checkout t.string :credit_card t.string :credit_card_name t.integer :credit_card_expiry_month t.integer :credit_card_expiry_year t.boolean :smoking t.integer :beds t.timestamps end end def self.down drop_table :bookings end end Tuesday, December 15, 2009
  • class CreateBookings < ActiveRecord::Migration def self.up create_table :bookings do |t| t.references :user t.references :hotel t.datetime :checkin t.datetime :checkout t.string :credit_card t.string :credit_card_name t.integer :credit_card_expiry_month t.integer :credit_card_expiry_year t.boolean :smoking t.integer :beds t.timestamps end end def self.down drop_table :bookings end end Tuesday, December 15, 2009
  • class CreateBookings < ActiveRecord::Migration def self.up create_table :bookings do |t| t.references :user t.references :hotel t.datetime :checkin t.datetime :checkout t.string :credit_card t.string :credit_card_name t.integer :credit_card_expiry_month t.integer :credit_card_expiry_year t.boolean :smoking t.integer :beds t.timestamps end end def self.down drop_table :bookings end end Tuesday, December 15, 2009
  • 190 vs 40 Tuesday, December 15, 2009
  • “Eles servem mais de 23 milhões de visitantes/mês. A conversão resultou em 20 mil linhas de Ruby em vez de 125 mil linhas de Java e, mais importante, facilitou a dificuldade que tinham em manutenção. Eles também finalizaram a reescrita do sistema em apenas 3 meses com 4 desenvolvedores. Uma vez completo e otimizado, o site deles agora é mais rápido que antes.” http://www.railsonwave.com/railsonwave/2008/6/4/yellowpages-com-migrates-to-rails Tuesday, December 15, 2009
  • “Eles servem mais de 23 milhões de visitantes/mês. A conversão resultou em 20 mil linhas de Ruby em vez de 125 mil linhas de Java e, mais importante, facilitou a dificuldade que tinham em manutenção. Eles também finalizaram a reescrita do sistema em apenas 3 meses com 4 desenvolvedores. Uma vez completo e otimizado, o site deles agora é mais rápido que antes.” http://www.railsonwave.com/railsonwave/2008/6/4/yellowpages-com-migrates-to-rails Tuesday, December 15, 2009
  • “Eles servem mais de 23 milhões de visitantes/mês. A conversão resultou em 20 mil linhas de Ruby em vez de 125 mil linhas de Java e, mais importante, facilitou a dificuldade que tinham em manutenção. Eles também finalizaram a reescrita do sistema em apenas 3 meses com 4 desenvolvedores. Uma vez completo e otimizado, o site deles agora é mais rápido que antes.” http://www.railsonwave.com/railsonwave/2008/6/4/yellowpages-com-migrates-to-rails Tuesday, December 15, 2009
  • “Eles servem mais de 23 milhões de visitantes/mês. A conversão resultou em 20 mil linhas de Ruby em vez de 125 mil linhas de Java e, mais importante, facilitou a dificuldade que tinham em manutenção. Eles também finalizaram a reescrita do sistema em apenas 3 meses com 4 desenvolvedores. Uma vez completo e otimizado, o site deles agora é mais rápido que antes.” http://www.railsonwave.com/railsonwave/2008/6/4/yellowpages-com-migrates-to-rails Tuesday, December 15, 2009
  • Ferramentas Ágeis Tuesday, December 15, 2009
  • Gitorious Repositórios Github Integrity Integração Contínua Cruise Control Capistrano Deployment Puppet Monitoramento New Relic Tuesday, December 15, 2009
  • Gitorious Repositórios Github Integrity Integração Contínua Cruise Control Capistrano Deployment Puppet Monitoramento New Relic Tuesday, December 15, 2009
  • Gitorious Repositórios Github Integrity Integração Contínua Cruise Control Capistrano Deployment Puppet Monitoramento New Relic Tuesday, December 15, 2009
  • Gitorious Repositórios Github Integrity Integração Contínua Cruise Control Capistrano Deployment Puppet Monitoramento New Relic Tuesday, December 15, 2009
  • Mitos? Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Mais Produtivo “Melhor” Anti-legado Tuesday, December 15, 2009
  • Sempre se Lembre Poderíamos contratar um Macaco Treinado para fazer seu Trabalho! Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Como é feito um software? Tuesday, December 15, 2009
  • “Engenharia” Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Análise Codi cação Tuesday, December 15, 2009
  • Programação “Compilação” Tuesday, December 15, 2009
  • “Codi cador” Tuesday, December 15, 2009
  • “Arquiteto” Tuesday, December 15, 2009
  • Standish Group - CHAOS Report 2009 Tuesday, December 15, 2009
  • Fracasso Total Sucesso 24% 32% Fracasso Médio 44% Standish Group - CHAOS Report 2009 Tuesday, December 15, 2009
  • Quebre Regras! Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Prazo Custo Tuesday, December 15, 2009
  • Escopo Prazo Custo Tuesday, December 15, 2009
  • Futuro Previsível? Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Winston W. Royce - 1970 Tuesday, December 15, 2009
  • “Eu acredito neste conceito mas a implementação descrita acima é arriscada e convida falhas.” Winston W. Royce - 1970 Tuesday, December 15, 2009
  • “Eu acredito neste conceito mas a implementação descrita acima é arriscada e convida falhas.” Winston W. Royce - 1970 Tuesday, December 15, 2009
  • “Eu acredito neste conceito mas a implementação descrita acima é arriscada e convida falhas.” Winston W. Royce - 1970 Tuesday, December 15, 2009
  • crédito: Jeff Patton Tuesday, December 15, 2009
  • crédito: Jeff Patton Tuesday, December 15, 2009
  • crédito: Jeff Patton Tuesday, December 15, 2009
  • crédito: Jeff Patton Tuesday, December 15, 2009
  • crédito: Jeff Patton Tuesday, December 15, 2009
  • crédito: Jeff Patton Tuesday, December 15, 2009
  • crédito: Jeff Patton Tuesday, December 15, 2009
  • crédito: Jeff Patton Tuesday, December 15, 2009
  • crédito: Jeff Patton Tuesday, December 15, 2009
  • crédito: Jeff Patton Tuesday, December 15, 2009
  • crédito: Jeff Patton Tuesday, December 15, 2009
  • “Soft”ware exige técnica e criatividade Tuesday, December 15, 2009
  • Trabalho Previsível? Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • // create some properties and get the default Session Properties props = new Properties(); props.put("mail.smtp.host", _smtpHost); Session session = Session.getDefaultInstance(props, null); // create a message Address replyToList[] = { new InternetAddress(replyTo) }; Message newMessage = new MimeMessage(session); if (_fromName != null) newMessage.setFrom(new InternetAddress(from, _fromName + " on behalf of " + replyTo)); else newMessage.setFrom(new InternetAddress(from)); newMessage.setReplyTo(replyToList); newMessage.setRecipients(Message.RecipientType.BCC, _toList); newMessage.setSubject(subject); newMessage.setSentDate(sentDate); // send newMessage Transport transport = session.getTransport(SMTP_MAIL); transport.connect(_smtpHost, _user, _password); transport.sendMessage(newMessage, _toList); Tuesday, December 15, 2009
  • new EmailMessage() .from("demo@guilhermechapiewski.com") .to("destination@address.com") .withSubject("Fluent Mail API") .withBody("Demo message") .send(); crédito: Guilherme Chapiewski Tuesday, December 15, 2009
  • Escopo Prazo Custo Tuesday, December 15, 2009
  • Escopo Qualidade Variável Prazo Custo Tuesday, December 15, 2009
  • Qualidade Escopo Variável Prazo Custo Tuesday, December 15, 2009
  • Qualidade Escopo Variável Prazo Custo Tuesday, December 15, 2009
  • Agilidade Tuesday, December 15, 2009
  • Agilidade não é Rapidez Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Robert C. Martin Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Código Limpo Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Test Driven Development Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • describe BankAccount do before :each do @bank_account = BankAccount.new :balance => 250 end it "should not be valid" do @bank_account.should be_valid end it "should transfer funds successfully" do @bank_account.should_receive(:transfer) .with_args(:amount => 100) .and_return(true) @bank_account.execute_transaction(:amount => 100) @bank_account.balance.should == 150 end end Tuesday, December 15, 2009
  • describe BankAccount do before :each do @bank_account = BankAccount.new :balance => 250 end it "should not be valid" do @bank_account.should be_valid end it "should transfer funds successfully" do @bank_account.should_receive(:transfer) .with_args(:amount => 100) .and_return(true) @bank_account.execute_transaction(:amount => 100) @bank_account.balance.should == 150 end end Tuesday, December 15, 2009
  • describe BankAccount do before :each do @bank_account = BankAccount.new :balance => 250 end it "should not be valid" do @bank_account.should be_valid end it "should transfer funds successfully" do @bank_account.should_receive(:transfer) .with_args(:amount => 100) .and_return(true) @bank_account.execute_transaction(:amount => 100) @bank_account.balance.should == 150 end end Tuesday, December 15, 2009
  • describe BankAccount do before :each do @bank_account = BankAccount.new :balance => 250 end it "should not be valid" do @bank_account.should be_valid end it "should transfer funds successfully" do @bank_account.should_receive(:transfer) .with_args(:amount => 100) .and_return(true) @bank_account.execute_transaction(:amount => 100) @bank_account.balance.should == 150 end end Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Funcionalidade: Adição Para evitar erros bobos Como um péssimo matemático Eu quero saber como somar dois números Cenário: Adicionar dois números Dado que eu digitei 50 na calculadora E que eu digitei 70 na calculadora Quando eu aperto o botão de soma Então o resultado na calculadora deve ser 120 Tuesday, December 15, 2009
  • Funcionalidade: Adição Para evitar erros bobos Como um péssimo matemático Eu quero saber como somar dois números Cenário: Adicionar dois números Dado que eu digitei 50 na calculadora E que eu digitei 70 na calculadora Quando eu aperto o botão de soma Então o resultado na calculadora deve ser 120 Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Não é mais demorado? Tuesday, December 15, 2009
  • Produtividade Cowboy Profissional Tuesday, December 15, 2009
  • Produtividade Cowboy Profissional 70.00 52.50 Produtividade 35.00 17.50 0 1 2 3 4 5 6 7 8 Tempo Tuesday, December 15, 2009
  • Produtividade Cowboy Profissional 70.00 52.50 Produtividade 35.00 17.50 0 1 2 3 4 5 6 7 8 Tempo Tuesday, December 15, 2009
  • Produtividade Cowboy Profissional 70.00 52.50 Produtividade 35.00 17.50 0 1 2 3 4 5 6 7 8 Tempo Tuesday, December 15, 2009
  • Produtividade Cowboy Profissional 70.00 52.50 Produtividade 35.00 17.50 0 1 2 3 4 5 6 7 8 Tempo Tuesday, December 15, 2009
  • Produtividade Cowboy Profissional 70.00 52.50 Produtividade 35.00 17.50 0 1 2 3 4 5 6 7 8 Tempo Tuesday, December 15, 2009
  • Produtividade Cowboy Profissional 70.00 52.50 Produtividade 35.00 17.50 0 1 2 3 4 5 6 7 8 Tempo Tuesday, December 15, 2009
  • Produtividade Cowboy Profissional 70.00 52.50 Produtividade 35.00 17.50 0 1 2 3 4 5 6 7 8 Tempo Tuesday, December 15, 2009
  • Produtividade Cowboy Profissional 70.00 52.50 Produtividade 35.00 17.50 0 1 2 3 4 5 6 7 8 Tempo Tuesday, December 15, 2009
  • Produtividade Cowboy Profissional 70.00 52.50 Produtividade 35.00 17.50 0 1 2 3 4 5 6 7 8 Tempo Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • 237 Equipes 137 Finalizadas Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Empreendedorismo Código e “Forma” Ciclo de Vida de Projetos Comunidade Open Source Tuesday, December 15, 2009
  • Empreendedorismo Código e “Forma” Ciclo de Vida de Projetos Comunidade Open Source Tuesday, December 15, 2009
  • Empreendedorismo Código e “Forma” Ciclo de Vida de Projetos Comunidade Open Source Tuesday, December 15, 2009
  • Empreendedorismo Código e “Forma” Ciclo de Vida de Projetos Comunidade Open Source Tuesday, December 15, 2009
  • Pro ssionalismo Tuesday, December 15, 2009
  • Tuesday, December 15, 2009
  • Obrigado! akitaonrails.com railssummit.com.br Tuesday, December 15, 2009