five minutes introduction for rails

Post on 30-Nov-2014

2.224 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

Presents

JINNISHIKAWA

SHINTAROKAKUTANI

Special Thanks

ESMLLWG

EIJIIENAGA

Special Thanks

AND

人はあらゆるプロセスよりも重要である。優れた人々に優れたプロセスを与えれば、プロセスを持たない優れた人々よりも常に効率が上がる。

ー Grady Booch

2005年12月13日

On December 13, 2005 the David Heinemeier Hanson major releasedon excellent framework for the all of its programmers.Its purpose was to get back the lost Quality of Engineering Lifeand to insure that the all of men who comprehensivewere the nice programmers in the world.

They succeeded.

Today, the Programmer calls it Web Application Framework.The programmers call it:

DHHはすべての

プログラマーのために

On December 13, 2005 the David Heinemeier Hanson major releasedon excellent framework for the all of its programmers.Its purpose was to get back the lost Quality of Engineering Lifeand to insure that the all of men who comprehensivewere the nice programmers in the world.

They succeeded.

Today, the Programmer calls it Web Application Framework.The programmers call it:

WebアプリケーションF/Wを

メジャーリリースした

On December 13, 2005 the David Heinemeier Hanson major releasedon excellent framework for the all of its programmers.Its purpose was to get back the lost Quality of Engineering Lifeand to insure that the all of men who comprehensivewere the nice programmers in the world.

They succeeded.

Today, the Programmer calls it Web Application Framework.The programmers call it:

目的は失われつつあるエンジニア人生の質

On December 13, 2005 the David Heinemeier Hanson major releasedon excellent framework for the all of its programmers.Its purpose was to get back the lost Quality of Engineering Lifeand to insure that the all of men who comprehensivewere the nice programmers in the world.

They succeeded.

Today, the Programmer calls it Web Application Framework.The programmers call it:

世界最高のWebアプリケーションF/Wの

呼び名は

On December 13, 2005 the David Heinemeier Hanson major releasedon excellent framework for the all of its programmers.Its purpose was to get back the lost Quality of Engineering Lifeand to insure that the all of men who comprehensivewere the nice programmers in the world.

They succeeded.

Today, the Programmer calls it Web Application Framework.The programmers call it:

分間の 入門

Get back the lost Quality of Engineering Life with

Part1: RailsPart1: Railsの思想の思想Part2: RailsPart2: Railsの構成の構成Part3: RailsPart3: RailsととRubyRuby

の思想

1.1.DRYDRY2.2.CoCCoC

DonDon ’’ ttRepeatRepeat

YourselfYourself

繰り返しを避けること

ConventionConventionoverover

ConfigurationConfiguration

設定よりも規約

まとめ

あとで

あとで

あとで書くあとで書く

あとで書く

の構成1.1.ARAR2.2.APAP3.3.RailsRails

ORMのパッケージ

より

PoEAAで紹介されているORMパターンのひとつ

http://http://capsctrl.que.jp/kdmsnr/wiki/PofEAA/?ActiveRecordcapsctrl.que.jp/kdmsnr/wiki/PofEAA/?ActiveRecord

データベースのテーブルデータベースのテーブルやビューの列をラップし、やビューの列をラップし、データベースアクセスをカデータベースアクセスをカプセル化し、ドメインロジップセル化し、ドメインロジックを追加するオブジェクトクを追加するオブジェクト

class Person < ActiveRecord::Baseend

app/models/app/models/person.rbperson.rb

ActiveRecord::Baseを継承

データベース管理

MigrationによるDB管理が可能

class CreatePeople < ActiveRecord::Migrationdef self.up

create_table :people do |table|table.column :first_name, :string, :limit => 32table.column :last_name, :string, :limit => 32table.column :number_of_dependents, :integer

endenddef self.down

drop_table :peopleend

end

db/migrate/001_create_people.rbdb/migrate/001_create_people.rb

ドメイン特化言語としてのRuby

RubyRubyだけ知っていればだけ知っていれば

よいか?よいか?

の威力

SQLの知識は重要、超重要

ActionControllerとActionViewを含むパッケージ

class PeopleController < ActionController::Basedef show@person = Person.find(params[:id])

endend

app/controllers/app/controllers/people_controller.rbpeople_controller.rb

ActionController::Baseを継承

<% for column in Person.content_columns %><p><b><%= column.human_name %>:</b><%=h @person.send(column.name) %>

</p><% end %>

app/views/people/app/views/people/show.rhtmlshow.rhtml

コントローラとインスタンス変数を共有する

<html><head><title><%= controller.action_name %></title>

</head><body><%= @content_for_layout %>

</body></html>

app/views/layouts/app/views/layouts/people.rhtmlpeople.rhtml

レイアウトを使って共通するビューをまとめる

レイヤーをつなげる線路

まとめ

ToolToolMattersMatters

職人は道具を選ぶ

道具重要

道具重要

と1.1.DSLDSL2.2.AgileAgile3.3.FunFun

なぜなぜDSLDSLが大事か?が大事か?

Human ReadableHuman Readable

コードは人間にとって読み易くあるべき

の効用

1.1.括弧を省略できる括弧を省略できる2.2.シンボルがオブジェクトシンボルがオブジェクト3.3.ブロックがあるブロックがある((名前空間の重複を防げる名前空間の重複を防げる))

http://blog.nikkeibp.co.jp/itpro/java/archives/2006/02/rubydsl.hhttp://blog.nikkeibp.co.jp/itpro/java/archives/2006/02/rubydsl.htmltml

RubyがDSLに向く3つの理由

宣言的な記述が可能

Is Is RubyRuby Agile?Agile?

オブジェクト倶楽部2005年クリスマスイベントにて

http://www.objectclub.jp/event/2005christmas/schedule#2http://www.objectclub.jp/event/2005christmas/schedule#2--22

まつもとさんの答え

Rubyはアジャイルである

http://www.rubyist.net/~matz/slides/oc2005/mgp00005.htmlhttp://www.rubyist.net/~matz/slides/oc2005/mgp00005.html

あとで書くあとで書く

あとで書く

まとめ

誇りと希望を持った仕事が誇りと希望を持った仕事がQoELQoELにつながるにつながる

結論コンパイルコンパイル / / ビルドのビルドの

終わりを終わりを待っているほど待っているほど

人生は長くはない人生は長くはないアジャイルな人の道具にはRubyが馴染むと思うのです

EnjoyEnjoyEngineering LifeEngineering Life

top related