Upload
koki-shimizu
View
576
Download
4
Embed Size (px)
DESCRIPTION
This presentation stands for overview to describe Ruby on Rails.
Citation preview
What is Rails?Rails is a web application development
framework written in the Ruby.
13年4月18日木曜日
The Rails philosophy includes several guiding principles
•DRY (Don’t Repeat Yourself)
•CoC (Convention over Configuration)
•REST(REpresentational State Transfer)
Railsはソフトウェア開発上重要な、いくつかの設計実装手法、考え方を元に作成されている。
13年4月18日木曜日
DRY
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
すべての知識はシステム内において、単一、かつ明確な、そして信頼できる表現になっていなければならない。
13年4月18日木曜日
DRY
• Documents and Code
• Code Comments
• State
• Class/Utlity
13年4月18日木曜日
CoCDesign paradigm to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility.
設定より規約。規約に従った実装を行い、開発者に決定させるべきことを少なくし、単純さを維持する。
13年4月18日木曜日
CoC
• Mapping File ( Class to DB Table )
• Class Name/ Method Name
• Folder Structure/ Namespace Design
• Template Method/ Class Design
13年4月18日木曜日
RESTREST is an architectural style and the best pattern for web application.
RESTは、アーキテクチャスタイルの一つであり、良いWEBアプリケーションのためのパターンである。
13年4月18日木曜日
REST
Resource Resource
Each request includes all of the information.
HTTP
The set of operations supported by the web service using HTTP
methods as known well-defined-interface (e.g., GET, PUT, POST, or
DELETE).
Uniform InterfaceStateless
HTML,XML or JSON etc
HTML,XML or JSON etc
Response is cacheable to improving scalability and
performance.Cacheable
KEY GOALS of REST include:•Scalability of component interactions•Generality of interfaces•Independent deployment of components•Intermediary components to reduce latency, enforce security and encapsulate legacy systems
13年4月18日木曜日
MVCModel-View-Controller
• Isolation of business Logic from the user interface
• Ease of keeping code DRY
• Making it clear where different types of code belong for easier maintenance
13年4月18日木曜日
MVCModel-View-Controller
• Isolation of business Logic from the user interface
• Ease of keeping code DRY
• Making it clear where different types of code belong for easier maintenance
Controller
View Model Storage
13年4月18日木曜日
MVCModel-View-Controller
• Isolation of business Logic from the user interface
• Ease of keeping code DRY
• Making it clear where different types of code belong for easier maintenance
①Controller
View Model Storage
Request to controller from user interface
13年4月18日木曜日
MVCModel-View-Controller
• Isolation of business Logic from the user interface
• Ease of keeping code DRY
• Making it clear where different types of code belong for easier maintenance
①
②Controller
View Model Storage
Request to controller from user interfaceController calls Model and gets results
13年4月18日木曜日
MVCModel-View-Controller
• Isolation of business Logic from the user interface
• Ease of keeping code DRY
• Making it clear where different types of code belong for easier maintenance
①
②③Controller
View Model Storage
Request to controller from user interfaceController calls Model and gets results
Controller puts View the results
13年4月18日木曜日
MVCModel-View-Controller
• Isolation of business Logic from the user interface
• Ease of keeping code DRY
• Making it clear where different types of code belong for easier maintenance
①
②③④Controller
View Model Storage
Request to controller from user interfaceController calls Model and gets results
Controller puts View the resultsView is rendered user interface
13年4月18日木曜日
MVC on Rails
13年4月18日木曜日
MVC on Rails
Controller
View Model DB
13年4月18日木曜日
MVC on Rails
Controller
View Model DB
Router
13年4月18日木曜日
MVC on Rails
①
Controller
View Model DB
Router
Browser posts request to Router
13年4月18日木曜日
MVC on Rails
①
Controller
View Model DB
Router discovers controller to execute and Rails executes the controller
Router
②
Browser posts request to Router
13年4月18日木曜日
MVC on Rails
①
③Controller
View Model DB
Router discovers controller to execute and Rails executes the controllerController calls Model and gets results
Router
②
Browser posts request to Router
13年4月18日木曜日
MVC on Rails
①
③④Controller
View Model DB
Router discovers controller to execute and Rails executes the controllerController calls Model and gets results
Controller puts View the results
Router
②
Browser posts request to Router
13年4月18日木曜日
MVC on Rails
①
③④⑤Controller
View Model DB
Router discovers controller to execute and Rails executes the controllerController calls Model and gets results
Controller puts View the resultsView is rendered user interface
Router
②
Browser posts request to Router
13年4月18日木曜日
Model13年4月18日木曜日
View•eRuby
•Sassy-CSS
•JavaScript(CoffeeScript)
•AJAX
•JQuery13年4月18日木曜日
Controller
•Redirect
•Session Manager13年4月18日木曜日
Development Flow on Rails
ControllerView
Model
ScaffoldMigration
One Iteration
13年4月18日木曜日