Skip to content

Commit 8305e09

Browse files
authored
Update Components.md
1 parent fc0e797 commit 8305e09

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/Components.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ An application is made of _components_. In this tutorial, a _component_ is an ob
2020
that usually has at least one of the following properties:
2121

2222
* it represents a "service" within your system, e.g. HTTP server, database access layer, etc.
23-
* it has some initialization logic with side effects
23+
* it has a lifecycle: initialization and destruction logic (with side effects)
24+
* it acquires and releases resources
25+
* it is stateful
2426
* it depends on other components
2527

2628

@@ -134,9 +136,9 @@ object MyApp extends Components {
134136

135137
`.ref` is not a real method. It exists only during compilation and is interpreted by the `component` or `singleton` macro.
136138
A dependency reference is extracted by the macro out of the component initialization expression.
137-
This way the macro separates initialization initialization of every component from initialization of its dependencies.
138-
This technique makes it possible to inspect the dependency graph before any components are initialized.
139-
This allows early cycle detection and lets us initialize independent components in parallel.
139+
This way the macro separates initialization of a component from initialization of its dependencies.
140+
This technique makes it possible to inspect the dependency graph before initializing any components.
141+
This allows early cycle detection and lets us parallelize component initialization.
140142

141143
**NOTE**: If you're familiar with `sbt`, then `.ref` works somewhat similarly to `.value` in `sbt` settings & task definitions.
142144

0 commit comments

Comments
 (0)