poodinis/example/injectioninitializer/app.d

25 lines
531 B
D
Raw Normal View History

2021-04-28 23:30:12 +02:00
/**
* Poodinis Dependency Injection Framework
* Copyright 2014-2021 Mike Bierlee
* 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({
writeln("Creating Doohickey via initializer delegate.");
return new Doohickey();
});
dependencies.resolve!Doohickey;
}