poodinis/example/injectioninitializer/app.d

25 lines
545 B
D
Raw Normal View History

2021-04-28 23:30:12 +02:00
/**
* Poodinis Dependency Injection Framework
2023-01-11 00:01:51 +01:00
* Copyright 2014-2023 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
{
}
void main()
{
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;
}