# Declarative binding by module **Intermediate.** Register where the class lives. Prefer to declare registration where the class lives? Tag it with `@md.scan_bind`, then register the whole module in one call. **`services.py`** — declare intent next to the code: ```python import melder as md @md.scan_bind(existence="unique", permissions="create") class MetricsHub: pass @md.scan_bind(existence="many", permissions="create") class JobTicket: pass ``` **`main.py`** — decide when it actually binds: ```python import melder as md import services book = md.Spellbook() bound = book.scan(services) # ← binds every tagged class in the module conduit = book.conjure() hub = conduit.meld("MetricsHub") ``` The decorator **stores intent only** — nothing touches the runtime until `scan()` runs. Importing `services` registers nothing: no hidden global container filling up behind your back, no import-order puzzle to debug. You still decide when binding happens, and where. Mix freely: scan a module, then `bind()` a few more by hand. `scan_bind` takes everything `bind()` takes for a target — `spellframe`, `binding_name`, `resolvable`, `disposal_method_names` and your own metadata keywords — and `permissions` is required. Only the decorated class or function itself is registered: its subclasses and instances are not, unless they are decorated too. --- ## Runnable examples - [Scan bind decorator](../examples/intermediate/01-scan-bind-decorator.md) — Intermediate 01 [All intermediate examples](../examples/intermediate/index.md) · [Level contents](index.md) · [Full contents](../contents.md) [Canonical page source](https://github.com/Synaptic724/melder/blob/4b364a338debcb1c010d0f6e9dcbbabb62945ba0/README.md)