add a short summary of the Examples

This commit is contained in:
Havoc Pennington 2011-12-04 20:51:24 -05:00
parent 1e1785cb75
commit 63b920acd1

View File

@ -65,6 +65,19 @@ See the examples in the `examples/` directory.
You can run these from the sbt console with the commands `project You can run these from the sbt console with the commands `project
simple-app` and then `run`. simple-app` and then `run`.
In brief, as shown in the examples:
- libraries should use a `Config` instance provided by the app,
if any, and use `ConfigFactory.load()` if no special `Config`
is provided. Libraries should put their defaults in a
`reference.conf` on the classpath.
- apps can create a `Config` however they want
(`ConfigFactory.load()` is easiest and least-surprising), then
provide it to their libraries. A `Config` can be created with
the parser methods in `ConfigFactory` or built up from any file
format or data source you like with the methods in
`ConfigValueFactory`.
## Standard behavior ## Standard behavior
The convenience method `ConfigFactory.load()` loads the following The convenience method `ConfigFactory.load()` loads the following