On this page
Compose an Application๏
Reader Question๏
What is the smallest complete Melder application shape?
Short Answer๏
Create a spellbook, bind ordinary Python objects, conjure once, then meld from the resulting conduit. The application keeps its own entry point and domain classes; Melder owns the compiled dependency world and the instances created inside it.
Representative Shape๏
import melder as md
book = md.Spellbook()
book.bind(spell=Config, existence="unique")
book.bind(spell=Repository, existence="unique")
book.bind(spell=Service, existence="unique_per_conduit")
conduit = book.conjure()
service = conduit.meld("Service")
Constructor annotations or explicit SpellMap values define dependency edges. Conjure
compiles and validates the graph; meld resolves or creates the requested object according
to its lifetime.
Why This Design Is Strong๏
User classes remain normal Python classes.
Graph validation is concentrated before steady-state resolution.
The conduit is an explicit runtime scope rather than a hidden global locator.
Cleanup belongs to the same owner that created the objects.
Tradeoffs๏
Registration is explicit and a spellbook produces one root conduit. Those restrictions make graph boundaries and root ownership unambiguous; additional scopes are represented as lesser conduits or separate spellbooks rather than repeated implicit construction.
Where to Go Next๏
Evidence: