Skip to content

Instantly share code, notes, and snippets.

View Fitzsimmons's full-sized avatar

Justin Fitzsimmons Fitzsimmons

View GitHub Profile
@Fitzsimmons
Fitzsimmons / rich_domain_models2.md
Created September 24, 2012 17:05 — forked from vsavkin/rich_domain_models2.md
Building Rich Domain Models in Rails (revision 2)

Building Rich Domain Models in Rails

Part 1. Decoupling Persistence

Abstract

Domain model is an effective tool for software development. It can be used to express really complex business logic, and to verify and validate the understanding of the domain among stakeholders. Building rich domain models in Rails is hard. Primarily, because of Active Record, which doesn't play well with the domain model approach.

One way to deal with this problem is to use an ORM implementing the data mapper pattern. Unfortunately, there is no production ready ORM doing that for Ruby. DataMapper 2 is going to be the first one.

Another way is to use Active Record just as a persistence mechanism and build a rich domain model on top of it. That's what I'm going to talk about here.

@Fitzsimmons
Fitzsimmons / spark.md
Created April 25, 2012 15:00 — forked from jesperfj/spark.md
Spark on Heroku

This guide will get you started using Spark on Heroku/Cedar. Spark is basically a clone of Sinatra for Java. 'Nuff said.

Create your app

Create a single Java main class in src/main/java/HelloWorld.java:

import static spark.Spark.*;
import spark.*;