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 20080515
Masahiro Umegaki
 
20090323 Phpstudy
20090323 Phpstudy20090323 Phpstudy
20090323 Phpstudy
Yusuke Ando
 
Understanding Web Services
Understanding Web ServicesUnderstanding Web Services
Understanding Web Services
aru85
 
Understanding Web Services
Understanding Web ServicesUnderstanding Web Services
Understanding Web Services
aru85
 
企业级搜索引擎Solr交流
企业级搜索引擎Solr交流企业级搜索引擎Solr交流
企业级搜索引擎Solr交流
chuan liang
 
Five Minutes Introduction For Rails
Five Minutes Introduction For RailsFive Minutes Introduction For Rails
Five Minutes Introduction For Rails
Koichi ITO
 
Web應用程式以及資安問題的探討
Web應用程式以及資安問題的探討Web應用程式以及資安問題的探討
Web應用程式以及資安問題的探討
Mu Chun Wang
 
CRE-016-商業智慧
CRE-016-商業智慧CRE-016-商業智慧
CRE-016-商業智慧
handbook
 

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 (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

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

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