public class DIContext:
Minimal dependency injection context.
This context stores named components and provides simple lookup APIs.
import klyn.di
context = DIContext()
service = Object()
context.registerComponent("service", service)
assert context.getComponent("service") == service| Modifier and Type | Member | Description |
|---|---|---|
| public | DIContextDIContext(): |
Creates an empty dependency injection context. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | getComponent | Returns a registered component by name. |
| public | registerComponent | Registers a component instance under a name. |
| public | scanAnnotationsscanAnnotations() as Void: |
Scans annotations and registers discovered components. |