the essence of using ruby on rails in corporations

95
企業システム開発に おけるRuby/Railsの 活用 伊藤忠テクノソリューションズ(株) [email protected] [email protected] 大場 光一郎 JUAS OSS活用研究プロジェクト; 2008-11-11(火) 1

Upload: koichiro-ohba

Post on 08-May-2015

1.966 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: The Essence of Using Ruby on Rails in Corporations

企業システム開発におけるRuby/Railsの活用

伊藤忠テクノソリューションズ(株)[email protected]

[email protected]大場 光一郎JUAS OSS活用研究プロジェクト; 2008-11-11(火)

1

Page 2: The Essence of Using Ruby on Rails in Corporations

CTCはRuby技術者認定試験をやってます。

2

Page 3: The Essence of Using Ruby on Rails in Corporations

自己紹介クロスファンクショングループシステムエンジニアリング室SI推進部開発環境推進課

3

Page 4: The Essence of Using Ruby on Rails in Corporations

開発システムジャーナル vol.7(マイコミ)RoR逆引きクイックリファレンス(マイコミ)まるごとRuby vol.1(Impress)JavaExpert #02(技術評論社)Scarabによるバグ追跡システム(オーム社)

Now Printing

4

Page 5: The Essence of Using Ruby on Rails in Corporations

JRubyと私

•NKF•Iconv

5

Page 6: The Essence of Using Ruby on Rails in Corporations

資料は公開します

6

Page 7: The Essence of Using Ruby on Rails in Corporations

Agenda•Railsの特徴を紹介•特徴にあった活用•人の育成•実際にやってみた

7

Page 8: The Essence of Using Ruby on Rails in Corporations

Rubyの特徴

•オブジェクト指向言語•スクリプト言語•動的な言語

8

Page 9: The Essence of Using Ruby on Rails in Corporations

まつもとゆきひろ氏9

Page 10: The Essence of Using Ruby on Rails in Corporations

10年以上の歴史

Ruby1.0

Ruby1.1

20001995 2010

Ruby1.2

Ruby1.3

Ruby1.4

Ruby1.6

Ruby1.8

Ruby1.9

Java1.0

Java1.1

Java1.2

Java1.3

Java1.4

Java5.0 Java 6

2005

10

Page 11: The Essence of Using Ruby on Rails in Corporations

Railsの概要

•Webアプリケーションフレームワーク

•MVC

11

Page 12: The Essence of Using Ruby on Rails in Corporations

MVC

Ruby on Rails

Browser

Database

Controller

ModelView

11

1214

15 13

16

12

Page 13: The Essence of Using Ruby on Rails in Corporations

デザインパターン

13

Page 14: The Essence of Using Ruby on Rails in Corporations

Railsで構築したサイト

14

Page 18: The Essence of Using Ruby on Rails in Corporations

Rails2つの理念

18

Page 19: The Essence of Using Ruby on Rails in Corporations

DRY1Don’t Repeat Yourself

19

Page 20: The Essence of Using Ruby on Rails in Corporations

CoC2Convention over Configuration

20

Page 22: The Essence of Using Ruby on Rails in Corporations

例:Modelclass User < Act... has_many :blogsend

class Blog < Act... belongs_to :userend

number

varcharmail

id

passwordname varchar

char

users

number

datetimeupdated_at

id

entryuser_id number

varchar

blogs

22

Page 23: The Essence of Using Ruby on Rails in Corporations

DSL

•Domain Specific Language

•ドメイン特化言語23

Page 24: The Essence of Using Ruby on Rails in Corporations

コード量が激減する

24

Page 25: The Essence of Using Ruby on Rails in Corporations

ジェネレータとは違います

25

Page 26: The Essence of Using Ruby on Rails in Corporations

メタプログラミング

26

Page 27: The Essence of Using Ruby on Rails in Corporations

実践Rails

オライリー・ジャパン社Brad Ediger著(株)クイープ訳3150円

目次

27

Page 28: The Essence of Using Ruby on Rails in Corporations

Scaffold•足場、ひな型•マスタメンテ•本格的アプリケーションでは使われない

28

Page 29: The Essence of Using Ruby on Rails in Corporations

Rai lsってなに?

29

Page 30: The Essence of Using Ruby on Rails in Corporations

オブジェクト指向(Ruby)+

デザインパターン(Rails)||

メタプログラミング(DSL)

30

Page 31: The Essence of Using Ruby on Rails in Corporations

Railsの特徴

31

Page 32: The Essence of Using Ruby on Rails in Corporations

Railsに先進的な発明が盛り込まれているわけではない

32

Page 33: The Essence of Using Ruby on Rails in Corporations

なにが人々を惹きつけるのか

33

Page 34: The Essence of Using Ruby on Rails in Corporations

プログラミングする上でよいとされるプラクティスが詰め込んである

34

Page 35: The Essence of Using Ruby on Rails in Corporations

アジャイル

35

Page 36: The Essence of Using Ruby on Rails in Corporations

アジャイル支援•マイグレーション•DBの変更がクラス並みに容易に

•少しづつ理想的なスキーマに育てる

36

Page 37: The Essence of Using Ruby on Rails in Corporations

テスト•ユニットテスト•ファンクショナルテスト•インテグレーションテスト•テスト駆動開発(TDD)

37

Page 38: The Essence of Using Ruby on Rails in Corporations

テストが変更する力を生み出す

38

Page 39: The Essence of Using Ruby on Rails in Corporations

RESTful39

Page 40: The Essence of Using Ruby on Rails in Corporations

REST

•かっこいいURL•規則的なURL•HTTPを活用しよう

40

Page 41: The Essence of Using Ruby on Rails in Corporations

http://unrest.com/login.do?jsessionid=09834ljjfsdioreiw8043

41

Page 43: The Essence of Using Ruby on Rails in Corporations

Ra i l sのパワー

43

Page 44: The Essence of Using Ruby on Rails in Corporations

バランスの妙

44

Page 45: The Essence of Using Ruby on Rails in Corporations

パレートの法則

•80-20ルール•20の力で80のことを•80まではカバーする

45

Page 46: The Essence of Using Ruby on Rails in Corporations

Railsの楽しさ

•小さな力•大きな変化•全能感

46

Page 47: The Essence of Using Ruby on Rails in Corporations

DRY,デザインパターン,メタプログラミング,

TDD,REST||

Rails

まとめ

47

Page 48: The Essence of Using Ruby on Rails in Corporations

得手不得手

(c) mckaysavage

mckaysavage

48

Page 49: The Essence of Using Ruby on Rails in Corporations

合わないプロジェクト

49

Page 50: The Essence of Using Ruby on Rails in Corporations

DRYじゃないDRYにしなくていい

(c) Jun Seita50

Page 51: The Essence of Using Ruby on Rails in Corporations

多数で同時開発

51

Page 52: The Essence of Using Ruby on Rails in Corporations

オブジェクト指向に不慣れ

52

Page 53: The Essence of Using Ruby on Rails in Corporations

テストを使わない

53

Page 54: The Essence of Using Ruby on Rails in Corporations

RESTじゃない

54

Page 55: The Essence of Using Ruby on Rails in Corporations

DB変更できない

55

Page 56: The Essence of Using Ruby on Rails in Corporations

Railsが得意とする武器が封じられる

56

Page 57: The Essence of Using Ruby on Rails in Corporations

できることJava Ruby

WebAppMailDB

Web ServiceAsyncLegacyAuth*

● ●● ●● ●● ▲● ▲● ▲● ▲

57

Page 58: The Essence of Using Ruby on Rails in Corporations

マッチするプロジェクトとメンバーならたいへんなパワーを生み出す

58

Page 59: The Essence of Using Ruby on Rails in Corporations

マッチするプロジェクトに適用する

59

Page 60: The Essence of Using Ruby on Rails in Corporations

Railsにマッチするメンバーを育てるには

60

Page 61: The Essence of Using Ruby on Rails in Corporations

プログラミング言語を使うと

61

Page 62: The Essence of Using Ruby on Rails in Corporations

思考のプロセスに影響する

62

Page 63: The Essence of Using Ruby on Rails in Corporations

RubyらしいRubyっぽい

63

Page 64: The Essence of Using Ruby on Rails in Corporations

The Ruby Way64

Page 65: The Essence of Using Ruby on Rails in Corporations

65

Page 66: The Essence of Using Ruby on Rails in Corporations

オブジェクト指向に精通デザインパターンに造詣

テストを愛する

66

Page 67: The Essence of Using Ruby on Rails in Corporations

王道は無い

67

Page 68: The Essence of Using Ruby on Rails in Corporations

みんながエキスパートでなくてもいい

68

Page 69: The Essence of Using Ruby on Rails in Corporations

Railsの性質を理解することで効果的に使える

69

Page 70: The Essence of Using Ruby on Rails in Corporations

Railsは自転車だ

70

Page 71: The Essence of Using Ruby on Rails in Corporations

背景の理論が分からなくても乗れる。原理、姿勢の出し方、力の入れ方を知ってると速く走れる。

71

Page 72: The Essence of Using Ruby on Rails in Corporations

人を育てるプロジェクト

とは72

Page 73: The Essence of Using Ruby on Rails in Corporations

ソースコードレビュー

73

Page 74: The Essence of Using Ruby on Rails in Corporations

ペアプログラミング

74

Page 75: The Essence of Using Ruby on Rails in Corporations

コミュニケーション

75

Page 76: The Essence of Using Ruby on Rails in Corporations

名前重要

76

Page 77: The Essence of Using Ruby on Rails in Corporations

Railsが取り入れているプラクティスを活用する

77

Page 78: The Essence of Using Ruby on Rails in Corporations

実際にやってみた

78

Page 79: The Essence of Using Ruby on Rails in Corporations

•10人は多い•6人以下くらい•1名は経験者が欲しい•経験者いなければ作る

79

Page 80: The Essence of Using Ruby on Rails in Corporations

進化の速いRails

80

Page 81: The Essence of Using Ruby on Rails in Corporations

Railsの歴史

Rails1.0.0

Rails1.1.0

Rails1.2.1

Rails2.0.0

Rails2.1.0

Rails2.2RC1

2005-12 2006-03 2007-01 2007-07 2008-06 2008/10

81

Page 82: The Essence of Using Ruby on Rails in Corporations

プラグインヘル

82

Page 83: The Essence of Using Ruby on Rails in Corporations

Enginesの悪夢

83

Page 84: The Essence of Using Ruby on Rails in Corporations

後方互換性の無い変更

84

Page 85: The Essence of Using Ruby on Rails in Corporations

追いつくのが大変更新も大変人に勧めるのも大変参考書籍が無い

85

Page 86: The Essence of Using Ruby on Rails in Corporations

鮫は泳ぐのを止めると死ぬ

86

Page 87: The Essence of Using Ruby on Rails in Corporations

バージョンを固定することでスキル停滞をまねく

87

Page 88: The Essence of Using Ruby on Rails in Corporations

新しいRailsには機能だけでなく新しい考え方が導入される

88

Page 89: The Essence of Using Ruby on Rails in Corporations

•Rails 2.0 → REST•Rails 2.1 → named_scope

•Rails 2.2 → 国際化、MT-safe

89

Page 90: The Essence of Using Ruby on Rails in Corporations

パフォーマンスが上がる

90

Page 91: The Essence of Using Ruby on Rails in Corporations

セキュリティの向上

91

Page 92: The Essence of Using Ruby on Rails in Corporations

Railsを使うということ•Rails的に行動する•オブジェクト指向•デザインパターン•メタプログラミング•テスト

92

Page 93: The Essence of Using Ruby on Rails in Corporations

まとめ•Railsの魅力•Railsに合うプロジェクトを選ぶ

•Railsをうまく使うには•Railsを使う上での課題

93

Page 94: The Essence of Using Ruby on Rails in Corporations

Rai lsは人を育てる

94

Page 95: The Essence of Using Ruby on Rails in Corporations

Any Question?

95