Skip to content

domain/app.aug ​

Modules and composition · Source and specification

Files in this project

Code ​

aug
// aug-spec: "app.aug.md" explains this file. Read it before changes; refresh with aug spec.
import Console from august.io
import Fruit from models
/** The application's explicit startup operation. */
interface Application:
    /** Writes the fruit names through the selected console. */
    start() uses Console.write
/** Construction stores dependencies; start performs the visible external work. */
ApplicationImpl(resolve Console console) implements Application:
    start():
        fruit to [Fruit(code=1, name="apple"), Fruit(name="pear", code=2)]
        for item in fruit:
            console.write(value=item.name)
aug
// aug-spec: "app.aug.md" explains this file. Read it before changes; refresh with aug spec.
import Console from august.io
import Fruit from models
/** The application's explicit startup operation. */
interface Application {
    /** Writes the fruit names through the selected console. */
    start() uses Console.write
}
/** Construction stores dependencies; start performs the visible external work. */
ApplicationImpl(resolve Console console) implements Application {
    start() {
        fruit to [Fruit(code=1, name="apple"), Fruit(name="pear", code=2)]
        for item in fruit {
            console.write(value=item.name)
        }
    }
}

Compiled specification ​

Interactions and sequences

Application · interface · source ​

The application's explicit startup operation.

Application.start · source ​

Writes the fruit names through the selected console. It can call Console.write.

ApplicationImpl · class · source ​

Construction stores dependencies; start performs the visible external work. It implements Application. The console dependency is injected as Console and stored read-only.

ApplicationImpl.start · source ​

Writes the fruit names through the selected console. It can call Console.write. It sets fruit to a list containing a Fruit with code 1 and name "apple", a Fruit with name "pear" and code 2. For each item in a snapshot of fruit, it passes item.name to console.write. source

Checked interface
text
start() returns void uses Console.write

It can call Console.write.

Dependencies ​

It uses Console (write) from august.io. It uses Fruit (name) from models.

Last updated:

The world runs on language