mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 12:14:01 +01:00
71ac539f2a
This commit deprecates non-canonical package module "dependency.d".
18 lines
400 B
D
18 lines
400 B
D
import poodinis;
|
|
|
|
interface Database{};
|
|
class RelationalDatabase : Database {}
|
|
|
|
class DataWriter {
|
|
@Autowire
|
|
public Database database; // Automatically injected when class is resolved
|
|
}
|
|
|
|
void main() {
|
|
auto dependencies = DependencyContainer.getInstance();
|
|
dependencies.register!DataWriter;
|
|
dependencies.register!(Database, RelationalDatabase);
|
|
|
|
auto writer = dependencies.resolve!DataWriter;
|
|
}
|