From c7780f8ae2b714b25e763704e8fa8f2af8f4b3c6 Mon Sep 17 00:00:00 2001 From: Adam Wiggins Date: Thu, 20 Oct 2011 18:23:51 -0600 Subject: [PATCH] feedback from seligman --- content/config.md | 2 +- content/dependencies.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/config.md b/content/config.md index 7e6700d..5be3091 100644 --- a/content/config.md +++ b/content/config.md @@ -7,7 +7,7 @@ An app's *config* is everything that is likely to vary between [deploys](/codeba * Credentials to external services such as Amazon S3 or Twitter * Per-deploy values such as the canonical hostname for the deploy -Apps sometimes store config as constants in the code. This is a violation of twelve-factor, which requires **strict separatation of config from code**. Config varies substantially across deploys, code does not. A litmus test for whether an app has all config correctly factored out of the code is whether the codebase could be open sourced as-is without compromising any credentials. +Apps sometimes store config as constants in the code. This is a violation of twelve-factor, which requires **strict separation of config from code**. Config varies substantially across deploys, code does not. A litmus test for whether an app has all config correctly factored out of the code is whether the codebase could be open sourced as-is without compromising any credentials. Another approach to config is the use of config files which are not checked into revision control, such as `config/database.yml` in Rails. This is a huge improvement over using constants which are checked into the code repo, but still has weaknesses: it's easy to mistakenly check in a config file to the repo; there is a tendency for config files to be scattered about in different places and different formats, making it hard to see and manage all the config in one place. Further, these formats tend to be language- or framework-specific. diff --git a/content/dependencies.md b/content/dependencies.md index 44ec7ff..f700d45 100644 --- a/content/dependencies.md +++ b/content/dependencies.md @@ -5,7 +5,7 @@ Most programming languages offer a packaging system for distributing support lib **A twelve-factor app never relies on implicit existence of system-wide packages.** It declares all dependencies, completely and exactly, via a *dependency declaration* manifest. Furthermore, it uses a *dependency isolation* tool during execution to ensure that no implicit dependencies "leak in" from the surrounding system. The full and explicit dependency specification is applied uniformly to both production and development -For example, [Gem Bundler](http://gembundler.com/) for Ruby offers the `Gemfile` manifest format for dependency declaration and `bundle exec` for dependency isolation. In, Python there are two separate tools for these steps -- [Pip](http://www.pip-installer.org/en/latest/) is used for declaration and [Virtualenv](http://www.virtualenv.org/en/latest/) for isolation. Even C has Autoconf for dependency declaration, and static linking can provide dependency isolation. No matter what the toolchain, dependency declaration and isolation must always be used together -- only one or the other is not sufficient to satisfy twelve-factor. +For example, [Gem Bundler](http://gembundler.com/) for Ruby offers the `Gemfile` manifest format for dependency declaration and `bundle exec` for dependency isolation. In, Python there are two separate tools for these steps -- [Pip](http://www.pip-installer.org/en/latest/) is used for declaration and [Virtualenv](http://www.virtualenv.org/en/latest/) for isolation. Java has a variety of build tools, such as [Maven](http://maven.apache.org/), which handle dependency declaration, and a limited `CLASSPATH` provides dependency isolation. Even C has Autoconf for dependency declaration, and static linking can provide dependency isolation. No matter what the toolchain, dependency declaration and isolation must always be used together -- only one or the other is not sufficient to satisfy twelve-factor. One benefit of explicit dependency declaration is that it simplifies setup for developers new to the app. The new developer can check out the app's codebase onto their development machine, requiring only the language runtime and dependency manager installed as prerequisites. They will be able to set up everything needed to run the app's code with a deterministic *build command*. For example, the build command for Ruby/Bundler is `bundle install`, while for Clojure/Leiningen it is `lein deps`.