Package Structure, Configuration, and Dependency Injection¶
Under development
This lesson is part of the course scaffold and is being actively written. The learning objectives and outline below define its final scope.
Learning objectives¶
By the end of this lesson you will be able to:
- Lay out a trading platform as an installable package with enforced boundaries between data, signals, portfolio, execution, and infrastructure layers
- Implement a layered configuration system — defaults, environment overrides, schema validation — that spans research, paper, and live trading without code changes
- Use dependency injection behind broker and data-feed interfaces so implementations can be swapped without touching strategy code
- Design a plugin mechanism that lets new strategies be added and discovered without modifying the platform core
Outline¶
- Package layout for a trading platform — modules, boundaries, dependency direction
- src layout, pyproject, and installable packages
- Configuration strategy — layers, per-environment overrides, schema validation
- Secrets and credentials — keeping them out of code and config files
- Dependency injection — constructor injection against protocols and interfaces
- Swapping brokers and data feeds — one interface, many implementations
- Plugin architectures — entry points, registries, and strategy discovery