On this page

Lifecycle map๏ƒ

๐ŸŸข Beginner ยท Lesson 19

The whole beginner lifecycle vocabulary on one page. Three modes answer one question - where does instance reuse stop? - and three is enough to build real things. (Three more exist for bigger worlds; they live in the later tiers.)

Before you run๏ƒ

Use the Beginner guide for prerequisite concepts. Run from a checkout with Melder installed and Python 3.14 free-threading selected. The collection download includes the level's local helper modules.

Run the saved script๏ƒ

python UX_and_AIX_experiences/01_beginner/19_lifecycle_map.py
py -3.14t UX_and_AIX_experiences/01_beginner/19_lifecycle_map.py

Download this collection ยท Source on GitHub

Public surface๏ƒ

md.Existence.unique / many / unique_per_conduit

Code๏ƒ

 1"""
 2TIER: beginner (19)
 3GOAL: The whole beginner lifecycle vocabulary on one page. Three modes
 4      answer one question - where does instance reuse stop? - and three
 5      is enough to build real things. (Three more exist for bigger
 6      worlds; they live in the later tiers.)
 7SURFACE EXERCISED: md.Existence.unique / many / unique_per_conduit
 8"""
 9import melder as md
10
11
12def main() -> None:
13    beginner_three = [
14        ("unique", "ONE instance, shared everywhere", "app config, registries"),
15        ("unique_per_conduit", "one per scope, stable inside it", "sessions, caches"),
16        ("many", "fresh construction EVERY meld", "requests, jobs, tickets"),
17    ]
18    for name, rule, use in beginner_three:
19        member = getattr(md.Existence, name)
20        print(f"{member.name:20s} {rule:38s} e.g. {use}")
21
22    later = [m.name for m in md.Existence
23             if m.name not in {n for n, _, _ in beginner_three}]
24    print("later tiers add:", ", ".join(sorted(later)))
25    assert len(beginner_three) == 3
26    print("three modes, one question: where does reuse stop?")
27
28
29if __name__ == "__main__":
30    main()

Check the outcome๏ƒ

The script contains its own assertions or demonstrated refusal paths. Run it to evaluate those checks against your installed version. The code above is taken directly from the saved file; no run output is invented here.

More beginner examples ยท Level guide

API contracts๏ƒ