SlideShare a Scribd company logo
1 of 58
Download to read offline
REST 信者から見た
Ruby on Rails 2.0
      山本陽平
  YAMAMOTO Yohei
REST 信者から見た
Ruby on Rails 2.1
      山本陽平
  YAMAMOTO Yohei
REST 信者から見た
 Ruby and Rails
      山本陽平
  YAMAMOTO Yohei
自己紹介
               Who am I
• ソフトウェアエンジニア
 – Software Engineer
• XML 野郎
 – XML guy
• REST 信者
 – RESTian
• ルビー初心者
 – JavaからRubyへ
 – Ruby beginner
 – from Java to Ruby
自慢
I’m very proud for…
Ruby スポン
サーな会社で
働いています

I’m working in Ruby
sponsor company
今日の話題
Today’s theme is…
REST と Ruby と
  Rails について
About REST and Ruby and Rails
まずは…
 First…
REST と Ruby について

  About REST and Ruby
REST と Ruby は仲良し

REST and Ruby are good friends
ruby-dev におけるRESTの議論

  REST discussion in ruby-dev
REST と Ruby は仲良し

REST and Ruby are good friends
REST と Rails も仲良し

REST and Ruby are also friends
REST と Rails は仲良し

REST and Rails are good friends
REST
Representational State Transfer
REST
• Web のアーキテクチャスタイル
 – Web Architectural style
• 制約の集合
 – Set of constrains
 – ULCODC$SS
抽象化レベル
     Abstraction Level
• Implementaion
  – Apache, Rails, Firefox, bot
• Architecture
  – User Agent, Server, HTTP, URI, HTML
• Architectural Style
  – Constrains, Styles
リソース指向アーキテクチャ


Resource Oriented Architecture
ROA の四つの構成要素
  Four features of the ROA
• (A) アドレス可能性
 – Addressability
• (S) ステートレス性
 – Statelessness
• (C) 接続性
 – Connectedness
• (U) 統一インターフェース
 – A Uniform Interface
A > C > U >>>>>>>>>S

アドレス可能性>接続性>統一インターフェース>>>>>>>>>>ステートレス性

Addressability > Connectedness > A Uniform Interface>>>>>>>>> Statelessness
ROA の四つの構成要素
  Four features of the ROA
• (A) アドレス可能性
 – Addressability
• (S) ステートレス性
 – Statelessness
• (C) 接続性
 – Connectedness
• (U) 統一インターフェース
 – A Uniform Interface
アドレス可能性
Addressability
アプリケーションがそのデータ
セットの重要な部分をリソースと
して公開する場合、そのアプリ
ケーションはアドレス可能である。

An application is
addressable if it exposes
the interesting aspects of
the data set as resources.
リソースは URI を通じて提供される
ため、アドレス可能なアプリケーショ
ンは提供可能な情報ごとにURI を公
開する。

Since resources are exposed
through URIs, an addressable
application exposes a URI for
every piece of information it
might conceivably serve.
リソース/URI 駆動開発
Resource/URI driven development
URI の設計
         ↓
     URI の実装
Design URI → Implement URI
URIの設計
URI design
Blog entries list resource
/entries
(GET/POST)

Blog entry resource
/entries/{entry_id}
(GET/PUT/DELETE)
URIの実装
URI implementation
map.resources :entries
シンプルだけど…
It’s simple, but…
Rails のルーティングは
素晴らしいが、コードの
構造に依存しがち

Routing of Rails is good, but
code structure dependent
URIは設計目標であって
  実装結果ではない
   URIs are design goal,
 not implementation result
Restlet
router.attach(“/entries”,
       EntryListResource.class);
router.attach(“/entries/{id}”,
       EntryResource.class);


Django
urlpatterns = patterns(
  (r’^entries/$’, entry_list),
  (r’^entries/([¥w-]+)/$’, entry_detail),
)
接続性
Connectedness
現在のページ == アプリケーション状態

 Current Page = Application State
ハイパーメディアを設計
== アプリケーションを設計

 Design hypermedia
 == design application
ハイパーメディアを設計
== リソースとリンクを設計

   Design hypermedia
== design resources and links
リンクの設計
 Link design
リンクの実装
Link implementation
url_for

link_to
シンプルだけど…
It’s simple, but…
リンクの意味を意識で
 きればもっといい
Semantics of a link is important
続きは WEB+DB
PRESS Vol. 45 で
まとめ
Conclusion
実際のところ Rails
は RESTful である
Actually, Rails is RESTful
アドレス可能性と
  接続性でよりよい設計を

               design by
        A better
addressability and connectedness
Rubykaigi2008: REST 信者から見た Ruby と Rails

More Related Content

Similar to Rubykaigi2008: REST 信者から見た Ruby と Rails

UAI seminor at nagoya 20080515
UAI seminor at nagoya 20080515UAI seminor at nagoya 20080515
UAI seminor at nagoya 20080515Masahiro Umegaki
 
20090323 Phpstudy
20090323 Phpstudy20090323 Phpstudy
20090323 PhpstudyYusuke Ando
 
Gorm @ gopher china
Gorm @ gopher chinaGorm @ gopher china
Gorm @ gopher chinaJinzhu
 
Understanding Web Services
Understanding Web ServicesUnderstanding Web Services
Understanding Web Servicesaru85
 
Understanding Web Services
Understanding Web ServicesUnderstanding Web Services
Understanding Web Servicesaru85
 
Chinaonrails Rubyonrails21 Zh
Chinaonrails Rubyonrails21 ZhChinaonrails Rubyonrails21 Zh
Chinaonrails Rubyonrails21 ZhJesse Cai
 
企业级搜索引擎Solr交流
企业级搜索引擎Solr交流企业级搜索引擎Solr交流
企业级搜索引擎Solr交流chuan liang
 
Five Minutes Introduction For Rails
Five Minutes Introduction For RailsFive Minutes Introduction For Rails
Five Minutes Introduction For RailsKoichi ITO
 
Web應用程式以及資安問題的探討
Web應用程式以及資安問題的探討Web應用程式以及資安問題的探討
Web應用程式以及資安問題的探討Mu Chun Wang
 
オブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 Rubyオブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 RubyKitajiro Kitayama
 
Ontology-based Content Management System (ICIM 2008)
Ontology-based Content Management System (ICIM 2008)Ontology-based Content Management System (ICIM 2008)
Ontology-based Content Management System (ICIM 2008)Brian Hsu
 
Rails Deployment with NginX
Rails Deployment with NginXRails Deployment with NginX
Rails Deployment with NginXStoyan Zhekov
 
Rails Cache
Rails CacheRails Cache
Rails Cachewear
 
090309seminar talk about Cloud Computing
090309seminar talk about Cloud Computing090309seminar talk about Cloud Computing
090309seminar talk about Cloud ComputingKohei Nishikawa
 
CRE-016-商業智慧
CRE-016-商業智慧CRE-016-商業智慧
CRE-016-商業智慧handbook
 
P2P Bug Tracking with SD
P2P Bug Tracking with SDP2P Bug Tracking with SD
P2P Bug Tracking with SDJesse Vincent
 

Similar to Rubykaigi2008: REST 信者から見た Ruby と Rails (20)

UAI seminor at nagoya 20080515
UAI seminor at nagoya 20080515UAI seminor at nagoya 20080515
UAI seminor at nagoya 20080515
 
20090323 Phpstudy
20090323 Phpstudy20090323 Phpstudy
20090323 Phpstudy
 
Revisited
RevisitedRevisited
Revisited
 
Gorm @ gopher china
Gorm @ gopher chinaGorm @ gopher china
Gorm @ gopher china
 
Understanding Web Services
Understanding Web ServicesUnderstanding Web Services
Understanding Web Services
 
Understanding Web Services
Understanding Web ServicesUnderstanding Web Services
Understanding Web Services
 
Chinaonrails Rubyonrails21 Zh
Chinaonrails Rubyonrails21 ZhChinaonrails Rubyonrails21 Zh
Chinaonrails Rubyonrails21 Zh
 
Ribbit
RibbitRibbit
Ribbit
 
企业级搜索引擎Solr交流
企业级搜索引擎Solr交流企业级搜索引擎Solr交流
企业级搜索引擎Solr交流
 
Five Minutes Introduction For Rails
Five Minutes Introduction For RailsFive Minutes Introduction For Rails
Five Minutes Introduction For Rails
 
Reification
ReificationReification
Reification
 
rails-footnotes
rails-footnotesrails-footnotes
rails-footnotes
 
Web應用程式以及資安問題的探討
Web應用程式以及資安問題的探討Web應用程式以及資安問題的探討
Web應用程式以及資安問題的探討
 
オブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 Rubyオブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 Ruby
 
Ontology-based Content Management System (ICIM 2008)
Ontology-based Content Management System (ICIM 2008)Ontology-based Content Management System (ICIM 2008)
Ontology-based Content Management System (ICIM 2008)
 
Rails Deployment with NginX
Rails Deployment with NginXRails Deployment with NginX
Rails Deployment with NginX
 
Rails Cache
Rails CacheRails Cache
Rails Cache
 
090309seminar talk about Cloud Computing
090309seminar talk about Cloud Computing090309seminar talk about Cloud Computing
090309seminar talk about Cloud Computing
 
CRE-016-商業智慧
CRE-016-商業智慧CRE-016-商業智慧
CRE-016-商業智慧
 
P2P Bug Tracking with SD
P2P Bug Tracking with SDP2P Bug Tracking with SD
P2P Bug Tracking with SD
 

More from Yohei Yamamoto

WebAPIのこれまでとこれから
WebAPIのこれまでとこれからWebAPIのこれまでとこれから
WebAPIのこれまでとこれからYohei Yamamoto
 
リコーUCSの開発をリーンスタートアップ的視点でふりかえる
リコーUCSの開発をリーンスタートアップ的視点でふりかえるリコーUCSの開発をリーンスタートアップ的視点でふりかえる
リコーUCSの開発をリーンスタートアップ的視点でふりかえるYohei Yamamoto
 
私の考えるドキュメント指向
私の考えるドキュメント指向私の考えるドキュメント指向
私の考えるドキュメント指向Yohei Yamamoto
 
CAPとBASEとEventually Consistent
CAPとBASEとEventually ConsistentCAPとBASEとEventually Consistent
CAPとBASEとEventually ConsistentYohei Yamamoto
 
良い Xml の見分け方 2007
良い Xml の見分け方 2007良い Xml の見分け方 2007
良い Xml の見分け方 2007Yohei Yamamoto
 

More from Yohei Yamamoto (8)

WebAPIのこれまでとこれから
WebAPIのこれまでとこれからWebAPIのこれまでとこれから
WebAPIのこれまでとこれから
 
リコーUCSの開発をリーンスタートアップ的視点でふりかえる
リコーUCSの開発をリーンスタートアップ的視点でふりかえるリコーUCSの開発をリーンスタートアップ的視点でふりかえる
リコーUCSの開発をリーンスタートアップ的視点でふりかえる
 
私の考えるドキュメント指向
私の考えるドキュメント指向私の考えるドキュメント指向
私の考えるドキュメント指向
 
CAPとBASEとEventually Consistent
CAPとBASEとEventually ConsistentCAPとBASEとEventually Consistent
CAPとBASEとEventually Consistent
 
良い Xml の見分け方 2007
良い Xml の見分け方 2007良い Xml の見分け方 2007
良い Xml の見分け方 2007
 
Rest 勝利宣言
Rest 勝利宣言Rest 勝利宣言
Rest 勝利宣言
 
イントロ
イントロイントロ
イントロ
 
REST 入門
REST 入門REST 入門
REST 入門
 

Recently uploaded

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

Rubykaigi2008: REST 信者から見た Ruby と Rails