Download ppt - Prazer,Ruby On Rails

Transcript
Page 1: Prazer,Ruby On Rails

Prazer, Ruby on Rails

Page 2: Prazer,Ruby On Rails

Quem?

•Alberto Leal

•BLOG: http://www.albertoleal.eti.br

•GITHUB: http://www.github.com/albertoleal

Page 3: Prazer,Ruby On Rails

O que?

•Apresentação da Linguagem RUBY

•Apresentação do Framework RAILS

•Testes Automatizados

•Hands-on

•Ferramentas

•RAILS e o Mercado

Page 4: Prazer,Ruby On Rails

Antes de mais nada ....

Page 5: Prazer,Ruby On Rails

Linguagem Programação

Framework

on

Page 6: Prazer,Ruby On Rails
Page 7: Prazer,Ruby On Rails

Yukihiro “Matz” Matsumoto

- Lançada em 1995- Linguagem de script- Código aberto e sem restrições- Simples e elegante

O Criador

Page 8: Prazer,Ruby On Rails

“Para mim o propósito da vida é parcialmente em ter prazer. Programadores as vezes sentem prazer quando podem se concentrar na parte criativa da programação. Então Ruby foi projetado para fazer programadores

felizes.”Matz

Page 9: Prazer,Ruby On Rails

Linguagens que influenciaram

•Perl - Linguagem Prática

•Smalltalk - Orientada a Objetos

•Lisp - Metaprogramação

•Smalltalk, Eifell - Sintaxe

•Java, Pyton - Tratamento de exceção

Page 10: Prazer,Ruby On Rails

Características• Interpretada

• Expressiva

• Herança Simples

• Dinâmica (monkeypatching)

• Multi-paradigma

• Clousures

• Mixins

• Duck Typing

• TUDO é OBJETO

Page 11: Prazer,Ruby On Rails

TUDO é OBJETO

Page 12: Prazer,Ruby On Rails

array[x]=y

array.[]=(x,y)

x+y

x.+(y)

Page 13: Prazer,Ruby On Rails

Duck Typing“Se anda como um pato e

fala como um pato, então é um pato!”

Page 14: Prazer,Ruby On Rails

Classes não são tipos! Tipos são definidos com base no

que um objeto pode fazer.

Page 15: Prazer,Ruby On Rails

Gems

Page 16: Prazer,Ruby On Rails

RubyGems

Page 17: Prazer,Ruby On Rails

Implementações

•MRI

•JRuby

•IronRuby

•Rubinius

Page 18: Prazer,Ruby On Rails
Page 19: Prazer,Ruby On Rails

Extraído a partir de um problema real!

Page 20: Prazer,Ruby On Rails

MVC

Page 21: Prazer,Ruby On Rails

ActiveRecordActionPackActionMailerActiveSupport

Meta-Framework

Page 22: Prazer,Ruby On Rails

Convenção ao invés de

Configuração

O que torna Rails ágil?

Page 23: Prazer,Ruby On Rails

class Post < ActiveRecord::Base has_many :comments belongs_to :author end

class Comment < ActiveRecord::Base belongs_to :post end

class Author < ActiveRecord::Base has_many :posts end

Page 24: Prazer,Ruby On Rails

Testes Automatizados

Page 25: Prazer,Ruby On Rails

BEHAVIOR DRIVEN DEVELOPMENT

TEST DRIVEN DEVELOPMENT

TDD

BDD

X

Page 26: Prazer,Ruby On Rails

Testes

Unitário

Funcional

Integração

Page 27: Prazer,Ruby On Rails

Construindo um e-commerce

Hands-on

Page 28: Prazer,Ruby On Rails

História 1

Page 29: Prazer,Ruby On Rails

História 2

Page 30: Prazer,Ruby On Rails

História 3

Page 31: Prazer,Ruby On Rails

Ferramentas

Mac OS X WindowsLinux

TextMate

emacs

emacs

RadRails + Aptana

NetbeansNetbeans

Netbeans

e outras ....

Page 32: Prazer,Ruby On Rails

Rails e o Mercado

Page 33: Prazer,Ruby On Rails

Empresas utilizando

Page 34: Prazer,Ruby On Rails

Empresas utilizando

Page 35: Prazer,Ruby On Rails

Sem Brigas, por favor

Java Ruby

Rails

.NETC

C++ C#

PerlPyton

Django

Merb

JSF

Struts...

Page 36: Prazer,Ruby On Rails

Dúvidas?

Page 37: Prazer,Ruby On Rails

Obrigado!