poodinis/example/injectioninitializer/app.d

23 lines
545 B
D
Raw Normal View History

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;
class Doohickey {
2021-04-28 23:30:12 +02:00
}
void main() {
2021-04-28 23:30:12 +02:00
auto dependencies = new shared DependencyContainer();
dependencies.register!Doohickey.initializedBy({
2021-04-28 23:30:12 +02:00
writeln("Creating Doohickey via initializer delegate.");
return new Doohickey();
});
dependencies.resolve!Doohickey;
}