rails as a pattern language

28
coryfoy.com Rails as a Pattern Language Cory Foy @cory_foy [email protected] http://coryfoy.com Friday, August 9, 13

Upload: cory-foy

Post on 20-May-2015

1.199 views

Category:

Technology


3 download

DESCRIPTION

In this talk, Cory Foy covers what is it that makes Rails more than a collection of Design Patterns and instead a Pattern Language

TRANSCRIPT

Page 1: Rails as a Pattern Language

coryfoy.com

Rails as a Pattern Language

Cory Foy@cory_foy

[email protected]://coryfoy.com

Friday, August 9, 13

Page 3: Rails as a Pattern Language

coryfoy.com

Friday, August 9, 13

Page 4: Rails as a Pattern Language

coryfoy.com

“[Rails is] not a blank slate equally tolerant of every kind of expression. On the

contrary, it trades that flexibility for the convenience of ‘what most people need

most of the time to do most things’”

- David Heinmeier Hansson - The Rails 3 Way

Friday, August 9, 13

Page 5: Rails as a Pattern Language

coryfoy.com

Ruby on Rails, often simply Rails, is an open source web application framework which

runs on the Ruby programming language. It is a full-stack framework: it allows creating

pages and applications that gather information from the web server, talk to or query the database, and render templates out of the box. As a result, Rails features a routing system that is independent of the

web server.

Friday, August 9, 13

Page 7: Rails as a Pattern Language

coryfoy.com

Patterns

Friday, August 9, 13

Page 8: Rails as a Pattern Language

coryfoy.com

Friday, August 9, 13

Page 9: Rails as a Pattern Language

coryfoy.com

“The elements of this language are entities called patterns. Each pattern describes a problem that occurs

over and over again in our environment, and then describes the core of the solution to that problem, in

such a way that you can use this solution a million times over, without ever doing it the same way twice.”

Christopher Alexander - “A Pattern Language”

Friday, August 9, 13

Page 10: Rails as a Pattern Language

coryfoy.com

“Each pattern is a rule which describes what you have to do to generate the entity which it defines”

Christopher Alexander - “The Timeless Way of Building”

Friday, August 9, 13

Page 11: Rails as a Pattern Language

coryfoy.com

• Characteristics

• Knowledge to Build the System

• Whether it is essential to solve a problem

Friday, August 9, 13

Page 12: Rails as a Pattern Language

coryfoy.com

Pattern Name

Intent

Motivation

Consequences

Implementation

Elements of a pattern

Friday, August 9, 13

Page 13: Rails as a Pattern Language

coryfoy.com

Pattern Language

Friday, August 9, 13

Page 14: Rails as a Pattern Language

coryfoy.com

“A pattern language is a system which allows its users to create an infinite variety of those three dimensional combinations of patterns which we call buildings,

gardens, towns.”Christopher Alexander - “The Timeless Way of Building”

Friday, August 9, 13

Page 15: Rails as a Pattern Language

coryfoy.com• North South Axis

• West Facing Entrance Down the Slope

• Two Floors

• Hay Loft at the Back

• Bedrooms in Front

• Garden to the South

• Pitched Roof

• Half-Hipped End

• Balcony Toward the Garden

• Carved Ornaments

Farmhouse in Bernese Oberland

Friday, August 9, 13

Page 16: Rails as a Pattern Language

coryfoy.comNatural vs Pattern Language

Natural Language Pattern Language

Words Patterns

Rules of grammar and meaning which give

connections

Patterns which specify connections between

patterns

Sentences Buildings and Places

Friday, August 9, 13

Page 17: Rails as a Pattern Language

coryfoy.com

“Advocates of this design approach claim that ordinary people can use it to successfully solve very large, complex

design problems.”Wikipedia - “Design Patterns”

Friday, August 9, 13

Page 18: Rails as a Pattern Language

coryfoy.com

Design a Building

Friday, August 9, 13

Page 19: Rails as a Pattern Language

coryfoy.com

Friday, August 9, 13

Page 20: Rails as a Pattern Language

coryfoy.com

Design a Web Application

Friday, August 9, 13

Page 21: Rails as a Pattern Language

coryfoy.com

Friday, August 9, 13

Page 22: Rails as a Pattern Language

coryfoy.comMapper

Active Record

Template View

Front Controller

Model-View Controller

Single Table Inheritance

Friday, August 9, 13

Page 23: Rails as a Pattern Language

coryfoy.com

Client

Server

Transport

Friday, August 9, 13

Page 24: Rails as a Pattern Language

coryfoy.com

RESTRouting

ValidationsControllersAction View

Action MailerActive RecordAuthentication

Session ManagementBackground Processing

Caching and PerformanceExtending Rails with Plugins

Friday, August 9, 13

Page 25: Rails as a Pattern Language

coryfoy.com

Friday, August 9, 13

Page 26: Rails as a Pattern Language

coryfoy.com

MERBData Mapper

HAMLInteractor Pattern

NoSQLScaling

Friday, August 9, 13