27
Ruby on Rails Overview Koki Shimizu ([email protected] ) 13418日木曜日

Ruby on Rails Overview

Embed Size (px)

DESCRIPTION

This presentation stands for overview to describe Ruby on Rails.

Citation preview

Page 1: Ruby on Rails Overview

Ruby on RailsOverview

Koki Shimizu([email protected])

13年4月18日木曜日

Page 2: Ruby on Rails Overview

What is Rails?Rails is a web application development

framework written in the Ruby.

13年4月18日木曜日

Page 3: Ruby on Rails Overview

The Rails philosophy includes several guiding principles

•DRY (Don’t Repeat Yourself)

•CoC (Convention over Configuration)

•REST(REpresentational State Transfer)

Railsはソフトウェア開発上重要な、いくつかの設計実装手法、考え方を元に作成されている。

13年4月18日木曜日

Page 4: Ruby on Rails Overview

DRY

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

すべての知識はシステム内において、単一、かつ明確な、そして信頼できる表現になっていなければならない。

13年4月18日木曜日

Page 5: Ruby on Rails Overview

DRY

• Documents and Code

• Code Comments

• State

• Class/Utlity

13年4月18日木曜日

Page 6: Ruby on Rails Overview

CoCDesign paradigm to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility.

設定より規約。規約に従った実装を行い、開発者に決定させるべきことを少なくし、単純さを維持する。

13年4月18日木曜日

Page 7: Ruby on Rails Overview

CoC

• Mapping File ( Class to DB Table )

• Class Name/ Method Name

• Folder Structure/ Namespace Design

• Template Method/ Class Design

13年4月18日木曜日

Page 8: Ruby on Rails Overview

RESTREST is an architectural style and the best pattern for web application.

RESTは、アーキテクチャスタイルの一つであり、良いWEBアプリケーションのためのパターンである。

13年4月18日木曜日

Page 9: Ruby on Rails Overview

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日木曜日

Page 10: Ruby on Rails Overview

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日木曜日

Page 11: Ruby on Rails Overview

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日木曜日

Page 12: Ruby on Rails Overview

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日木曜日

Page 13: Ruby on Rails Overview

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日木曜日

Page 14: Ruby on Rails Overview

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日木曜日

Page 15: Ruby on Rails Overview

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日木曜日

Page 16: Ruby on Rails Overview

MVC on Rails

13年4月18日木曜日

Page 17: Ruby on Rails Overview

MVC on Rails

Controller

View Model DB

13年4月18日木曜日

Page 18: Ruby on Rails Overview

MVC on Rails

Controller

View Model DB

Router

13年4月18日木曜日

Page 19: Ruby on Rails Overview

MVC on Rails

Controller

View Model DB

Router

Browser posts request to Router

13年4月18日木曜日

Page 20: Ruby on Rails Overview

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日木曜日

Page 21: Ruby on Rails Overview

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日木曜日

Page 22: Ruby on Rails Overview

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日木曜日

Page 23: Ruby on Rails Overview

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日木曜日

Page 24: Ruby on Rails Overview

Model13年4月18日木曜日

Page 25: Ruby on Rails Overview

View•eRuby

•Sassy-CSS

•JavaScript(CoffeeScript)

•AJAX

•JQuery13年4月18日木曜日

Page 26: Ruby on Rails Overview

Controller

•Redirect

•Session Manager13年4月18日木曜日

Page 27: Ruby on Rails Overview

Development Flow on Rails

ControllerView

Model

ScaffoldMigration

One Iteration

13年4月18日木曜日