2021-04-28 23:30:12 +02:00
|
|
|
/**
|
|
|
|
* Poodinis Dependency Injection Framework
|
2024-02-17 13:08:59 +01:00
|
|
|
* Copyright 2014-2024 Mike Bierlee
|
2021-04-28 23:30:12 +02:00
|
|
|
* This software is licensed under the terms of the MIT license.
|
|
|
|
* The full terms of the license can be found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import poodinis;
|
|
|
|
import std.stdio;
|
|
|
|
|
2023-03-06 23:24:18 +01:00
|
|
|
class Doohickey {
|
2021-04-28 23:30:12 +02:00
|
|
|
}
|
|
|
|
|
2023-03-06 23:24:18 +01:00
|
|
|
void main() {
|
2021-04-28 23:30:12 +02:00
|
|
|
auto dependencies = new shared DependencyContainer();
|
2021-04-29 00:11:34 +02:00
|
|
|
dependencies.register!Doohickey.initializedBy({
|
2021-04-28 23:30:12 +02:00
|
|
|
writeln("Creating Doohickey via initializer delegate.");
|
|
|
|
return new Doohickey();
|
|
|
|
});
|
|
|
|
|
|
|
|
dependencies.resolve!Doohickey;
|
|
|
|
}
|