Upload
cory-foy
View
1.196
Download
3
Tags:
Embed Size (px)
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
Citation preview
coryfoy.com
Rails as a Pattern Language
Cory Foy@cory_foy
[email protected]://coryfoy.com
Friday, August 9, 13
coryfoy.com
Not to be confused with Ruby (programming language).
- Wikipedia
Friday, August 9, 13
coryfoy.com
Friday, August 9, 13
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
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
coryfoy.com
Ruby on Rails emphasizes the use of well-known software engineering patterns and principles, such as active record pattern,
convention over configuration (CoC), don't repeat yourself (DRY), and model-view-
controller (MVC).
Friday, August 9, 13
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
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
coryfoy.com
• Characteristics
• Knowledge to Build the System
• Whether it is essential to solve a problem
Friday, August 9, 13
coryfoy.com
Pattern Name
Intent
Motivation
Consequences
Implementation
Elements of a pattern
Friday, August 9, 13
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
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
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
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
coryfoy.comMapper
Active Record
Template View
Front Controller
Model-View Controller
Single Table Inheritance
Friday, August 9, 13
coryfoy.com
RESTRouting
ValidationsControllersAction View
Action MailerActive RecordAuthentication
Session ManagementBackground Processing
Caching and PerformanceExtending Rails with Plugins
Friday, August 9, 13
coryfoy.com
MERBData Mapper
HAMLInteractor Pattern
NoSQLScaling
Friday, August 9, 13
Cory Foy (@cory_foy)[email protected]://coryfoy.com
Friday, August 9, 13
Cory Foy (@cory_foy)[email protected]://coryfoy.com
Friday, August 9, 13