why-is-implementationpattterns-important-so-much

168
何故そんなにも 日本Rubyの会 / Ruby札幌 島田浩二 [email protected] 2008-03-19(水); Apple Store Sapporo Ruby Sapporo Night vol.5 Pattern is a key connects Ruby and Agile ImplementationPatterns は重要なのか

Upload: koji-shimada

Post on 12-Nov-2014

4.098 views

Category:

Business


1 download

DESCRIPTION

Ruby Sapporo Night Vol.5

TRANSCRIPT

Page 1: Why-is-ImplementationPattterns-important-so-much

何故そんなにも

日本Rubyの会 / Ruby札幌島田浩二

[email protected]

2008-03-19(水); Apple Store SapporoRuby Sapporo Night vol.5

Pattern is a key connects Ruby and Agile

ImplementationPatterns

は重要なのか

Page 2: Why-is-ImplementationPattterns-important-so-much

Our initial success using a pattern language for user interface design

has left us quit enthusiastic about possibilities for computer users designing and

programming their own applications.

パターン言語の使用が最初に成功したとき、コンピューター・ユーザーたちが

自分自身のアプリケーションを自ら設計し、プログラミングするという可能性があるのだということに、

我々は大変熱狂した

- Kent Beck, Ward Cunningham「オブジェクト指向プログラムのためのパターン言語の使用」

Page 3: Why-is-ImplementationPattterns-important-so-much

しまだこうじ

✓ ふつうのフリーランスプログラマ✓ 日本Rubyの会✓ Ruby札幌 運営✓ RubyKaigi 2007 当日スタッフ✓ るびま、るりま✓ プログラミングの楽しさを共有したい✓ 自分の知らないコトやヒトに出会いたい

http://iddy.jp/profile/snoozer05

Page 4: Why-is-ImplementationPattterns-important-so-much

しまだこうじ

✓ Implementation Patterns Group ✓ Implementation PatternsとSBPPを味わうためのグループです

http://iddy.jp/profile/snoozer05

http://implementationpatterns.g.hatena.ne.jp/

Page 5: Why-is-ImplementationPattterns-important-so-much

Implementation Patterns

Page 6: Why-is-ImplementationPattterns-important-so-much

Implementation Patterns

Kent Beck待望の新刊

Page 8: Why-is-ImplementationPattterns-important-so-much

http://www.flickr.com/photos/improveit/1574912686/

Kent Beck✓ パターン

Page 9: Why-is-ImplementationPattterns-important-so-much

http://www.flickr.com/photos/improveit/1574912686/

Kent Beck✓ パターン✓ CRCカード

Page 10: Why-is-ImplementationPattterns-important-so-much

http://www.flickr.com/photos/improveit/1574912686/

Kent Beck✓ パターン✓ CRCカード✓ XP

Page 11: Why-is-ImplementationPattterns-important-so-much

http://www.flickr.com/photos/improveit/1574912686/

Kent Beck✓ パターン✓ CRCカード✓ XP✓ TDD

Page 12: Why-is-ImplementationPattterns-important-so-much

http://www.flickr.com/photos/improveit/1574912686/

Kent Beck✓ パターン✓ CRCカード✓ XP✓ TDD✓ JUnit

Page 13: Why-is-ImplementationPattterns-important-so-much

キーマン(鍵的じゃない意味で)

Page 14: Why-is-ImplementationPattterns-important-so-much

Implementation Patterns

Kent Beck待望の新刊

Page 15: Why-is-ImplementationPattterns-important-so-much

パターン?What is Pattern?

Page 16: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向における再利用のためのデザインパターン

Page 17: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向における再利用のためのデザインパターン

✓ Abstract Factory✓ Adapter✓ Bridge✓ Builder✓ Chain of Responsibility✓ Command✓ Composite✓ Observer✓ Prototype✓ Strategy✓ Templete Method✓ Visitor

✓ Decorator✓ Facade✓ Factory Method✓ Flyweight✓ Interpreter✓ Iterator✓ Mediator✓ Memento✓ Proxy✓ Singleton✓ State

Page 18: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向における再利用のためのデザインパターン

✓ Abstract Factory✓ Adapter✓ Bridge✓ Builder✓ Chain of Responsibility✓ Command✓ Composite✓ Observer✓ Prototype✓ Strategy✓ Templete Method✓ Visitor

✓ Decorator✓ Facade✓ Factory Method✓ Flyweight✓ Interpreter✓ Iterator✓ Mediator✓ Memento✓ Proxy✓ Singleton✓ State

Page 19: Why-is-ImplementationPattterns-important-so-much

パターン?What is Pattern?

Page 21: Why-is-ImplementationPattterns-important-so-much

パターンの起源Origin of Pattern

Page 22: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向プログラムのためのパターン言語の使用

Using Pattern Languagesfor Object-Oriented Program

By Kent Beck, Ward Cunningham

Page 23: Why-is-ImplementationPattterns-important-so-much

角征典さんによる翻訳

http://capsctrl.que.jp/kdmsnr/wiki/transl/?UsingPatternLanguagesForOOP

Page 24: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向プログラムのためのパターン言語の使用

Page 25: Why-is-ImplementationPattterns-important-so-much

✓ オブジェクト指向プログラミングのための適切な方法論の探索

オブジェクト指向プログラムのためのパターン言語の使用

Page 26: Why-is-ImplementationPattterns-important-so-much

✓ オブジェクト指向プログラミングのための適切な方法論の探索✓ 旧来の方法論はオブジェクト指向プログラミングに最適していない

オブジェクト指向プログラムのためのパターン言語の使用

Page 27: Why-is-ImplementationPattterns-important-so-much

✓ オブジェクト指向プログラミングのための適切な方法論の探索✓ 旧来の方法論はオブジェクト指向プログラミングに最適していない

✓ 最も重要な設計事項であるユーザ・インタフェースに重きを置いた方法論もない

オブジェクト指向プログラムのためのパターン言語の使用

Page 28: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向プログラムのためのパターン言語の使用

Page 29: Why-is-ImplementationPattterns-important-so-much

✓ Christopher Alexander氏は言ってるよ

オブジェクト指向プログラムのためのパターン言語の使用

Page 30: Why-is-ImplementationPattterns-important-so-much

✓ Christopher Alexander氏は言ってるよ✓ 建物は、実際にそこにいる人たちの手によって設計され、作られるべき

オブジェクト指向プログラムのためのパターン言語の使用

Page 31: Why-is-ImplementationPattterns-important-so-much

✓ Christopher Alexander氏は言ってるよ✓ 建物は、実際にそこにいる人たちの手によって設計され、作られるべき

✓ プログラムも利用者によって書かれるべき

オブジェクト指向プログラムのためのパターン言語の使用

Page 32: Why-is-ImplementationPattterns-important-so-much

✓ Christopher Alexander氏は言ってるよ✓ 建物は、実際にそこにいる人たちの手によって設計され、作られるべき

✓ プログラムも利用者によって書かれるべき✓ でも、規模とか複雑性とか(ry

オブジェクト指向プログラムのためのパターン言語の使用

Page 33: Why-is-ImplementationPattterns-important-so-much

✓ Christopher Alexander氏は言ってるよ✓ 建物は、実際にそこにいる人たちの手によって設計され、作られるべき

✓ プログラムも利用者によって書かれるべき✓ でも、規模とか複雑性とか(ry✓ それパターン言語で出来るよ!

オブジェクト指向プログラムのためのパターン言語の使用

Page 34: Why-is-ImplementationPattterns-important-so-much

✓ Christopher Alexander氏は言ってるよ✓ 建物は、実際にそこにいる人たちの手によって設計され、作られるべき

✓ プログラムも利用者によって書かれるべき✓ でも、規模とか複雑性とか(ry✓ それパターン言語で出来るよ!✓ 実際にやってみた

オブジェクト指向プログラムのためのパターン言語の使用

Page 35: Why-is-ImplementationPattterns-important-so-much

✓ Christopher Alexander氏は言ってるよ✓ 建物は、実際にそこにいる人たちの手によって設計され、作られるべき

✓ プログラムも利用者によって書かれるべき✓ でも、規模とか複雑性とか(ry✓ それパターン言語で出来るよ!✓ 実際にやってみた

オブジェクト指向プログラムのためのパターン言語の使用

Page 36: Why-is-ImplementationPattterns-important-so-much

時を超えた建築の道The Timeless Way of

Building

By Christopher Alexander

Page 37: Why-is-ImplementationPattterns-important-so-much

時を超えた建築の道

Page 38: Why-is-ImplementationPattterns-important-so-much

✓ 依頼主が望む建築を一番理解しているのは、本来依頼主自身のはず

時を超えた建築の道

Page 39: Why-is-ImplementationPattterns-important-so-much

✓ 依頼主が望む建築を一番理解しているのは、本来依頼主自身のはず

✓ 建築家の役割は、依頼主を設計に参加可能にすること

時を超えた建築の道

Page 40: Why-is-ImplementationPattterns-important-so-much

✓ 依頼主が望む建築を一番理解しているのは、本来依頼主自身のはず

✓ 建築家の役割は、依頼主を設計に参加可能にすること

✓ パターン言語を建築家と依頼主の共通言語として機能させることでこれを実現すべき

時を超えた建築の道

Page 41: Why-is-ImplementationPattterns-important-so-much

✓ 依頼主が望む建築を一番理解しているのは、本来依頼主自身のはず

✓ 建築家の役割は、依頼主を設計に参加可能にすること

✓ パターン言語を建築家と依頼主の共通言語として機能させることでこれを実現すべき

時を超えた建築の道

Page 42: Why-is-ImplementationPattterns-important-so-much

パターン言語Pattern Language

Page 43: Why-is-ImplementationPattterns-important-so-much

✓ 町(1-94)自立地域、農業渓谷、田舎町、田園、小高い場所、環状道路、都市の魔力...

✓ 建物(95-204)複合建物、小さな駐車場、通り抜け街路、繋がった建物、座れる階段...

✓ 施工(205-253)生活空間に従う構造、無駄の無い構造、ボックス柱、さわれる花...

パターン言語のカテゴリ

- http://gc.sfc.keio.ac.jp/class/2005_22687/slides/10/6.html

Page 44: Why-is-ImplementationPattterns-important-so-much

パターン言語

Page 45: Why-is-ImplementationPattterns-important-so-much

✓ パターン:ある形態を生み出すためのルール

パターン言語

Page 46: Why-is-ImplementationPattterns-important-so-much

✓ パターン:ある形態を生み出すためのルール✓ 言語:様々な大きさ・種類の部品が有機的に繋がることによって多様な意味が生まれる構造

パターン言語

Page 47: Why-is-ImplementationPattterns-important-so-much

✓ パターン:ある形態を生み出すためのルール✓ 言語:様々な大きさ・種類の部品が有機的に繋がることによって多様な意味が生まれる構造

✓ パターン言語:建築において繰り返し登場する形を生み出すルールを、言語的な構造として表現したもの

パターン言語

Page 48: Why-is-ImplementationPattterns-important-so-much

✓ 町(1-94)自立地域、農業渓谷、田舎町、田園、小高い場所、環状道路、都市の魔力...

✓ 建物(95-204)複合建物、小さな駐車場、通り抜け街路、繋がった建物、座れる階段...

✓ 施工(205-253)生活空間に従う構造、無駄の無い構造、ボックス柱、さわれる花...

パターン言語のカテゴリ

- http://gc.sfc.keio.ac.jp/class/2005_22687/slides/10/6.html

Page 49: Why-is-ImplementationPattterns-important-so-much

パターン言語

「町」

「建物」

「施工」

抽象

具体

(戦術タクティクス)

(戦略ストラテジー)

パターン言語

パターン パターンのカテゴリ- http://gc.sfc.keio.ac.jp/class/2005_22687/slides/10/6.html

Page 50: Why-is-ImplementationPattterns-important-so-much

パターン?What is Pattern?

Page 51: Why-is-ImplementationPattterns-important-so-much

✓ 依頼主が望む建築をどのようにすべきかを一番理解しているのは、本来依頼主自身のはず

✓ 建築家の役割は、依頼主を設計に参加可能にすること

✓ パターン言語を建築家と依頼主の共通言語として機能させることでこれを実現すべき

時を超えた建築の道

Page 52: Why-is-ImplementationPattterns-important-so-much

✓ 利用者が望むプログラムをどのようにすべきかを一番理解しているのは、利用者自身のはず

✓ プログラマの役割は、利用者を設計に参加可能にすること

✓ パターン言語をプログラマと利用者の共通言語として機能させることでこれを実現すべき

オブジェクト指向プログラムのためのパターン言語の使用

Page 53: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向における再利用のためのデザインパターン

✓ Abstract Factory✓ Adapter✓ Bridge✓ Builder✓ Chain of Responsibility✓ Command✓ Composite✓ Observer✓ Prototype✓ Strategy✓ Templete Method✓ Visitor

✓ Decorator✓ Facade✓ Factory Method✓ Flyweight✓ Interpreter✓ Iterator✓ Mediator✓ Memento✓ Proxy✓ Singleton✓ State

Page 54: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向における再利用のためのデザインパターン

✓ Abstract Factory✓ Adapter✓ Bridge✓ Builder✓ Chain of Responsibility✓ Command✓ Composite✓ Observer✓ Prototype✓ Strategy✓ Templete Method✓ Visitor

✓ Decorator✓ Facade✓ Factory Method✓ Flyweight✓ Interpreter✓ Iterator✓ Mediator✓ Memento✓ Proxy✓ Singleton✓ State

パターン言語のカテゴリの一つ

カテゴリを構成するパターン

Page 55: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向プログラミングのパターン言語の適応について概説する。(中略)これは、オブジェクト指向プログラムの完全なパターン言語を記録する我々の現在の活動から得られたものだ。

Page 56: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向プログラミングのパターン言語の適応について概説する。(中略)これは、オブジェクト指向プログラムの完全なパターン言語を記録する我々の現在の活動から得られたものだ。

Page 57: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向プログラムの完全なパターン言語A Pattern Language for OOP

Page 58: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向プログラムの完全なパターン言語A Pattern Language For OOP

GoF本の現在の立ち位置とはちょっと違う

Page 59: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向プログラムの完全なパターン言語A Pattern Language For OOP

どこへいってしまったんだろう?

Page 60: Why-is-ImplementationPattterns-important-so-much

パターン言語の行方Where did a pattern language go?

Page 61: Why-is-ImplementationPattterns-important-so-much

ヒント

Page 62: Why-is-ImplementationPattterns-important-so-much

ヒント✓ パターンの後にKent Beckが生み出したもの

Page 63: Why-is-ImplementationPattterns-important-so-much

ヒント✓ パターンの後にKent Beckが生み出したもの✓ 利用者の設計への関与を促すもの

Page 64: Why-is-ImplementationPattterns-important-so-much

ヒント✓ パターンの後にKent Beckが生み出したもの✓ 利用者の設計への関与を促すもの✓ まるでパターンで構成されたパターン言語のように、形を生み出すルールを一定の形式でまとめたもの

Page 65: Why-is-ImplementationPattterns-important-so-much

エクストリーム プログラミングeXtreme Programming

Page 66: Why-is-ImplementationPattterns-important-so-much

eXtreme Programming

Page 67: Why-is-ImplementationPattterns-important-so-much

eXtreme Programming

✓ 5 個の価値✓ 14 個の原則✓ 14 個の基礎プラクティス✓ 11 個の応用プラクティス

Page 68: Why-is-ImplementationPattterns-important-so-much

eXtreme Programming

「価値」

「原則」

「プラクティス」

抽象

具体

(戦術タクティクス)

(戦略ストラテジー)

エクストリームプログラミング

Page 69: Why-is-ImplementationPattterns-important-so-much

eXtreme Programming

「価値」

「原則」

「プラクティス」

抽象

具体

(戦術タクティクス)

(戦略ストラテジー)

エクストリームプログラミングとても良く似ている

Page 70: Why-is-ImplementationPattterns-important-so-much

伏線foreshadowing

Page 71: Why-is-ImplementationPattterns-important-so-much

パターン コミュニティHillside Group

Page 72: Why-is-ImplementationPattterns-important-so-much

Pattern Language of Program Design

活動の記録

Page 73: Why-is-ImplementationPattterns-important-so-much

開発プロセスの生成的パターン言語

A Generative Development -Process Pattern Language

By James O. Coplien

Page 74: Why-is-ImplementationPattterns-important-so-much

開発プロセスの生成的パターン言語

Page 75: Why-is-ImplementationPattterns-important-so-much

開発プロセスの生成的パターン言語

✓ スケジュールの大きさを決めよ

Page 76: Why-is-ImplementationPattterns-important-so-much

開発プロセスの生成的パターン言語

✓ スケジュールの大きさを決めよ✓ 組織は市場に従う

Page 77: Why-is-ImplementationPattterns-important-so-much

開発プロセスの生成的パターン言語

✓ スケジュールの大きさを決めよ✓ 組織は市場に従う✓ 開発者がプロセスをコントロールする

Page 78: Why-is-ImplementationPattterns-important-so-much

開発プロセスの生成的パターン言語

✓ スケジュールの大きさを決めよ✓ 組織は市場に従う✓ 開発者がプロセスをコントロールする✓ 顧客を引き込め...etc

Page 79: Why-is-ImplementationPattterns-important-so-much

開発プロセスの生成的パターン言語

Page 80: Why-is-ImplementationPattterns-important-so-much

開発プロセスの生成的パターン言語

Page 81: Why-is-ImplementationPattterns-important-so-much

PLoPがXPを生んだXP is a Pattern Language too.

Page 82: Why-is-ImplementationPattterns-important-so-much

XPとパターン

http://capsctrl.que.jp/kdmsnr/wiki/transl/?UsingPatternLanguagesForOOP

Ralph Johnsonの見解

Page 83: Why-is-ImplementationPattterns-important-so-much

XPには「信頼性」や「理解容易性」に直接関連するパターンが無いにも関わらず、「プラクティス全体」が結びついて、信頼が高く理解が容易なシステムを生成してしまいます。

Page 84: Why-is-ImplementationPattterns-important-so-much

…パターン同様、一つ一つのプラクティスには名前があり、それ自身を学ぶことができます。パターン同様、プラクティス全体が結びつくことで、個々の単純な足し合わせよりも大きな効果が得られるのです。…

Page 85: Why-is-ImplementationPattterns-important-so-much

…結論としての私の意見は、XPはAlexanderスタイルの開発をソフトウェアにどうやって適応するかを示す、ソフトウェアのためのパターン言語である、というものです

Page 86: Why-is-ImplementationPattterns-important-so-much

パターン・ムーブメントからアジャイル・ムーブメントへ

http://blogs.itmedia.co.jp/hiranabe/2005/10/post_dc1e.html

平鍋さんによる解説

Page 87: Why-is-ImplementationPattterns-important-so-much

From Pattern To Agile

パターン・ムーブメントからアジャイル・ムーブメントへ

Page 88: Why-is-ImplementationPattterns-important-so-much

オブジェクト指向プログラムの完全なパターン言語A Pattern Language for OOP

Page 89: Why-is-ImplementationPattterns-important-so-much

パターンとはPattern is

Page 90: Why-is-ImplementationPattterns-important-so-much

パターン言語の全体像

抽象

具体

(戦術タクティクス)

(戦略ストラテジー)

パターン言語

Page 91: Why-is-ImplementationPattterns-important-so-much

Implementation Patterns

Kent Beck待望の新刊

Page 92: Why-is-ImplementationPattterns-important-so-much

Implementation Patterns

なぜ今パターンなのか?

Page 93: Why-is-ImplementationPattterns-important-so-much

A Short Introduction ToPattern Language

Smalltalk Report, Feb, 1993

By Kent Beck

Page 94: Why-is-ImplementationPattterns-important-so-much

発想の原点Origin Of Idea

Page 95: Why-is-ImplementationPattterns-important-so-much

コードに込められたプログラマの意図をどうやって

それを利用する人に伝えることが出来るか

Page 96: Why-is-ImplementationPattterns-important-so-much

一つの答えOne Answer

Page 97: Why-is-ImplementationPattterns-important-so-much

文芸的プログラミングLiterate Programming

Page 98: Why-is-ImplementationPattterns-important-so-much

プログラミングは芸術であり文学でもある

Page 99: Why-is-ImplementationPattterns-important-so-much

文学であるということは人のためのコードを書く

ということ

Page 100: Why-is-ImplementationPattterns-important-so-much

問題点Problem

Page 101: Why-is-ImplementationPattterns-important-so-much

特別なシステムを使うとなるとその分の負荷が

プログラマにかかってしまう

Page 102: Why-is-ImplementationPattterns-important-so-much

構造が直線的であるため複雑で多層な構造の情報を

表現するのが難しい

Page 104: Why-is-ImplementationPattterns-important-so-much

時を超えた建築の道The Timeless Way of

Building

By Christopher Alexander

Page 105: Why-is-ImplementationPattterns-important-so-much

確認Point

Page 106: Why-is-ImplementationPattterns-important-so-much

発想の原点Origin Of Idea

Page 107: Why-is-ImplementationPattterns-important-so-much

コードに込められたプログラマの意図をどうやって

それを利用する人に伝えることが出来るか

Page 108: Why-is-ImplementationPattterns-important-so-much

Implementation Patterns

何故書かれたのか?

Page 109: Why-is-ImplementationPattterns-important-so-much

Implementation Patterns

何故重要なのか?

Page 110: Why-is-ImplementationPattterns-important-so-much

This is a book about programming - specifically, about programming

so other people can understand your code.

本書はプログラミングについての書籍だ.具体的には

他人があなたのコードを理解できるようにプログラミングするための書籍だ

- Kent Beck「Implementation Patterns」

Page 111: Why-is-ImplementationPattterns-important-so-much

Dave Thomas says...

Page 112: Why-is-ImplementationPattterns-important-so-much

ソフトウェアエンジニアリングという言葉はありません.少なくともまだないです.

これ以上ないところまで削るのがエンジニアリング.これ以上削れないところまで削るということはどこまで削るとそれが壊れてしまうかわかっているということです.まだソフトウェアに関しては

我々はそのレベルまで達していないんです.

達していないから、まだソフトウェアエンジニアリングという言葉は嘘である.

我々がしているのはコーディングです.

Page 113: Why-is-ImplementationPattterns-important-so-much

僕らがしているのはプログラミング

Page 114: Why-is-ImplementationPattterns-important-so-much

大切にしなければいけないのはプログラミングという作業

そしてコード

Page 115: Why-is-ImplementationPattterns-important-so-much

それらを大切にするための具体的な方法論

Page 116: Why-is-ImplementationPattterns-important-so-much

...a programmer’s job is too communicatewith other programmers, not just a machine.

Programming, then, is a human task done by humans for humans.

Oh, and writing good code at the same time.

プログラミングは、マシンにだけではなく、自分以外のプログラマに向けて書かれるべきなんだ。

そうすることで、プログラミングは人による、人のための、人の仕事になる。

もちろん、それは良いコードにもなっているんだよ。

- Kent Beck「Implementation Patterns」

Page 117: Why-is-ImplementationPattterns-important-so-much

Implementation Patterns

読んでみると良いと思う

Page 118: Why-is-ImplementationPattterns-important-so-much

それともう一つ...One more thing...

Page 119: Why-is-ImplementationPattterns-important-so-much

パターン言語の性質Element of Pattern Language

Page 120: Why-is-ImplementationPattterns-important-so-much

✓ 利用者が開発者でもあることを許容する✓ そのための利用者側の負荷を低減する✓ 形を生み出すためのルールをパターン化し✓ それらの有機的な結びつきにより多様な意味を生み出せること

パターン言語の性質

Page 121: Why-is-ImplementationPattterns-important-so-much

✓ プログラマにオープンであり✓ そのための利用者側の負荷を低減する✓ 形を生み出すためのルールをパターン化し✓ それらの有機的な結びつきにより多様な意味を生み出せること

パターン言語の性質

Page 122: Why-is-ImplementationPattterns-important-so-much

✓ プログラマにオープンであり✓ 楽しく、自然に、簡単に、がコンセプトで✓ 形を生み出すためのルールをパターン化し✓ それらの有機的な結びつきにより多様な意味を生み出せること

パターン言語の性質

Page 123: Why-is-ImplementationPattterns-important-so-much

✓ プログラマにオープンであり✓ 楽しく、自然に、簡単に、がコンセプトで✓ 豊富なライブラリを備えていて✓ それらの有機的な結びつきにより多様な意味を生み出せること

パターン言語の性質

Page 124: Why-is-ImplementationPattterns-important-so-much

✓ プログラマにオープンであり✓ 楽しく、自然に、簡単に、がコンセプトで✓ 豊富なライブラリを備えていて✓ 動的で柔軟な繋がりによって、それらが多様な意味を持ちうる

パターン言語の性質

Page 125: Why-is-ImplementationPattterns-important-so-much

どうみてもRubyです

Page 126: Why-is-ImplementationPattterns-important-so-much

パターン言語とRubyRuby As Pattern Language

Page 127: Why-is-ImplementationPattterns-important-so-much

きっかけ

Page 128: Why-is-ImplementationPattterns-important-so-much

Design Patterns In Ruby

Page 129: Why-is-ImplementationPattterns-important-so-much

デザインパターンをRubyで

Page 130: Why-is-ImplementationPattterns-important-so-much

だけでなく

Page 131: Why-is-ImplementationPattterns-important-so-much

Rubyならではのパターンの探索

Patterns For Ruby

Page 132: Why-is-ImplementationPattterns-important-so-much

Patterns For Ruby

Page 133: Why-is-ImplementationPattterns-important-so-much

Patterns For Ruby

✓ DSL

Page 134: Why-is-ImplementationPattterns-important-so-much

Patterns For Ruby

✓ DSL✓ メタプログラミング

Page 135: Why-is-ImplementationPattterns-important-so-much

Patterns For Ruby

✓ DSL✓ メタプログラミング✓ 設定より規約

Page 136: Why-is-ImplementationPattterns-important-so-much

ドメイン特化言語Domain Specific Language

Page 137: Why-is-ImplementationPattterns-important-so-much

特定の問題領域の解決に特化してデザインされた言語

Page 138: Why-is-ImplementationPattterns-important-so-much

class CreateEvents < ActiveRecord::Migration def self.up create_table :events do |t| t.string :title t.string :url t.datetime :deadline t.datetime :publish_at

t.timestamp end end

def self.down drop_table :events endend

Page 139: Why-is-ImplementationPattterns-important-so-much

class Manager < ActiveRecord::Base belongs_to :department has_one :office has_many :committeesend

Page 140: Why-is-ImplementationPattterns-important-so-much

ドメイン特化言語

Page 141: Why-is-ImplementationPattterns-important-so-much

✓ 問題に対して言語を最適化するアプローチ

ドメイン特化言語

Page 142: Why-is-ImplementationPattterns-important-so-much

✓ 問題に対して言語を最適化するアプローチ✓ 問題を利用する人のわかる言葉で

ドメイン特化言語

Page 143: Why-is-ImplementationPattterns-important-so-much

✓ 問題に対して言語を最適化するアプローチ✓ 問題を利用する人のわかる言葉で✓ RubyはDSLの良いプラットフォーム

ドメイン特化言語

Page 144: Why-is-ImplementationPattterns-important-so-much

メタプログラミングMeta Programming

Page 145: Why-is-ImplementationPattterns-important-so-much

メタプログラミングでオブジェクトを柔軟に拡張するということ

Page 146: Why-is-ImplementationPattterns-important-so-much

class BankAccount attr_accessor :balance

def initialize(opning_balance) @balance = opning_balance end end

Page 147: Why-is-ImplementationPattterns-important-so-much

class Car extend Forwardable def_deligators :@engine, :start, :stop

def initialize @engine = Engine.new end end

Page 148: Why-is-ImplementationPattterns-important-so-much

メタプログラミングの利用

Page 149: Why-is-ImplementationPattterns-important-so-much

✓ 問題に対して言語を最適化するアプローチ

メタプログラミングの利用

Page 150: Why-is-ImplementationPattterns-important-so-much

✓ 問題に対して言語を最適化するアプローチ✓ 利用者が表現したいことをそのまま書ける

メタプログラミングの利用

Page 151: Why-is-ImplementationPattterns-important-so-much

✓ 問題に対して言語を最適化するアプローチ✓ 利用者が表現したいことをそのまま書ける✓ Rubyはメタプログラミングをしやすい

メタプログラミングの利用

Page 152: Why-is-ImplementationPattterns-important-so-much

DSL等で言語を利用者の思考に近づけていく試み

Page 153: Why-is-ImplementationPattterns-important-so-much

パターン言語で技術を人の側に近づけていく試み

Page 154: Why-is-ImplementationPattterns-important-so-much

本質的には同じ

Page 155: Why-is-ImplementationPattterns-important-so-much

というよりもDSLはパターン言語の

可能性の一つ

Page 156: Why-is-ImplementationPattterns-important-so-much

RubyはDSLの良いプラットフォーム

Page 157: Why-is-ImplementationPattterns-important-so-much

Rubyが海外のアジャイルな人たちの間で盛り上がった理由

Page 158: Why-is-ImplementationPattterns-important-so-much

Rubyとアジャイルな開発が相性が良い理由

Page 159: Why-is-ImplementationPattterns-important-so-much

結論

Page 160: Why-is-ImplementationPattterns-important-so-much
Page 161: Why-is-ImplementationPattterns-important-so-much

それともう一つ...One more thing...

Page 162: Why-is-ImplementationPattterns-important-so-much

最後に

Page 163: Why-is-ImplementationPattterns-important-so-much

アジャイル系の勉強会しませんか?How about workshop about agile together?

Page 164: Why-is-ImplementationPattterns-important-so-much

アジャイル系の勉強会しませんか?How about workshop about agile together?

Page 165: Why-is-ImplementationPattterns-important-so-much

一緒にやれると嬉しいです

Page 166: Why-is-ImplementationPattterns-important-so-much

何故そんなにも

日本Rubyの会 / Ruby札幌島田浩二

[email protected]

2008-03-19(水); Apple Store SapporoRuby Sapporo Night vol.5

ImplementationPatterns

は重要なのかPattern is a key connects Ruby and Agile

Page 167: Why-is-ImplementationPattterns-important-so-much

ご清聴ありがとうございました

Page 168: Why-is-ImplementationPattterns-important-so-much

何かご質問は?