Skip to content

“Object Orientation Revisited. Simplicity and power with DCI.” by Trygve Reenskaug

Great presentation by Trygve Reenskaug, the creator of MVC, on an extension of OO principles, called DCI (Data, Context, Interaction). If you are a programmer, watch this on Vimeo!

A DCI Class says everything about the inside of an object and nothing about its neighbors.

A DCI Context says everything about a network of communicating objects and nothing about their insides.

The DCI paradigm

View gist:3186304
Follow the instructions here: The Hitchhiker's Guide to Riding a
Mountain Lion, including installing XQuartz.
After installing XQuartz set the correct path to the X11 library to
install Ruby 1.8.7-p358 with rbenv:
export CPPFLAGS=-I/opt/X11/include
then let the compiler know where gcc-4.2 is:
View gist:3079208
# From
$ brew update
$ brew install libxml2 libxslt
$ brew link libxml2 libxslt
$ wget
$ tar xvfz libiconv-1.13.1.tar.gz
$ cd libiconv-1.13.1
$ ./configure --prefix=/usr/local/Cellar/libiconv/1.13.1
$ make
View gist:3079197
$ brew update
$ brew install mysql
$ mysql_install_db --verbose --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
$ mkdir -p ~/Library/LaunchAgents
$ cp /usr/local/Cellar/mysql/5.5.25a/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
$ mysql -uroot
View gist:853708
User john:
ssh john@common-machine
screen -S pairprog
Ctrl-a :multiuser on
Ctrl-a :acladd pete
User pete:
View gist:821880
rake --trace
(in /Users/jpinnix/.vim)
** Invoke default (first_time)
** Invoke ack.vim (first_time)
** Execute ack.vim
* Installing ack.vim *
View gist:558528
App details:
Rails 3.0.0
Bundler 1.0 (fork for Rails 3)
Ran bundle install, everything installed correctly. Checked in Gemfile.lock and
added 'require "bundler/capistrano"' to deploy.rb. Works totally fine on local.
But on deploy it locks up when trying to init submodules:
No submodule mapping found in .gitmodules for path
View gist:547977
# Help nginx+passenger serve static index pages
# Site specific config
server {
listen 80;
index index.html;
access_log logs/appname.access.log;
error_log logs/appname.error.log;
View image.rb
class Image < ActiveRecord::Base
before_create, :set_width_and_height
has_attached_file :img,
:url => "/system/images/:attachment/:id/:basename.:extension",
:path => "#{Rails.root}/public/system/images/:attachment/:id/:basename.:extension"
def set_width_and_height
# this next line is the magic line
geo = Paperclip::Geometry.from_file(img.to_file(:original))
View download_twitter_feed.rake
desc "Download Twitter Feed"
task :download_twitter_feed do
require 'open-uri'
etag_cache = open( "#{RAILS_ROOT}/public/system/etag_cache.txt" ).read
Something went wrong with that request. Please try again.