Newsletter: Patterns

Datetime:2017-04-14 05:16:49         Topic: Design Pattern          Share        Original >>
Here to See The Original Article!!!


Issue 12 ~ 4/7/2017

Rubyists have always had a strange relationship with design patterns. They smell a little too much Java, like people in starched shirts and ties writing serious software for humorless people. Yet Ruybyists use and rely on patterns just like all developers. We've even been known to have the occasional religious war over them.

The history of Ruby over the past 10 years is intimately tied to design patterns. In this issue of the RubyLetter we're going to look at where patterns come from, how they evolve over time, and how knowing them will make you a better developer.


Design patterns are nothing more than good ideas. When you write enough code you may have the same good ideas over and over. So you document them, get a book deal, and hit the lecture circuit.

Software isn't the only field where this happens. In 1977, Christopher Alexander published A Pattern Language which describes a number of patterns that can be used to build houses, public spaces, and even whole cities. Skimming this book almost feels like playing a simulation game: "I'll put an 'agricultural town' here with 'pedestrian town square' and a 'rustic beer hall.'" Now you just sit back and let the Simoleons roll in.


The Timeless Way of Building

The concept of 'design patterns' doesn't originate in computer science but in architecture. This talk introduces us to architectural design patterns and draws parallels to software development.


A Pattern Language

This is a PDF of the book discussed in the 'Timeless Way of Building' presentation above.


Patterns of Enterprise Application Architecture

A summary of all of the design patterns from POEAA - one of the seminal books on design patterns in software development.

Ruby on patterns

Early versions of Rails weren't much more than Ruby plus two design patterns: MVC and Active Record. You might even say that these were the "rails" in "Ruby on Rails."

This was the first introduction to patterns than many of us had and it sparked a bit of a renaissance. Soon every major language had its own MVC framework and books like Head First Design Patterns started to fly off the shelves.


What the Hell is MVC?

Not sure how the MVC pattern works? This video provides a very approachable introduction.


Cultivating Design Patterns

Many people worry that design patterns are too rigid. This talk shows us how they can be used flexibly to aid communication and guide development.


Design Patterns in Ruby

This git repo contains implementations of 14 design patterns covered in the book 'Design Patterns in Ruby' by Russ Olsen.


N Design Patterns You Might Actually Use

This presentation discusses patterns commonly used in web applications, with code and examples of real-world use cases.

Beyond Rails

Rails has dominated Rubyland for a long time. But a few years ago, the Ruby community started to realize that the Rails way isn't always the best way.

People found that large Rails projects tend to be hard to maintain. Models grow to enormous size. Views become tangled webs of conditionals. Nobody really knows what do do with controllers.

If you attended a Ruby conference around 2014 all you heard was people talking about how to solve this problem. In many ways these discussions were about design patterns: replacing or augmenting MVC with something else, using DataMapper instead of ActiveRecord, using Dependency Injection instead of inheritance.


Design patterns to refactor MVC

This article discusses seven design patterns that can be used to refactor MVC projects that have grown unwieldy


SOLID Design

While most 'traditional' patterns are about tactics, SOLID is more about strategy. It's a good example of how the idea of design patterns has evolved over the years.


Dependency Injection

Dependency injection is fundamental to the 'new' style of Ruby programming that became popular due in no small part to Sandi Metz's 'Practical Object-Oriented Design in Ruby' book.

Parting Words

I have no doubt that the way Rubyists use design patterns will continue to evolve. That's a good thing. Some of the changes will, no doubt, turn out to be fads and fade into history. But some of them will be genuinely good and useful.

One interesting thing to me is how the rise in single-page applications and front-end Javascript is causing the views (the V in MVC) to evolve. Next week I think it'll be fun to look at the various options we have when building front-ends for Ruby web apps.