From 7afefd9d9c9cd80caf62946148cab0b4df40c660 Mon Sep 17 00:00:00 2001 From: Mike Bierlee Date: Sun, 22 Jun 2014 16:35:08 +0200 Subject: [PATCH] Add workaround to readme --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7e562e8..adba8ee 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,18 @@ Poodinis can autowire circular dependencies when they are registered with single Known issues ------------ * Due to preventive measures of recursion issues in circular dependencies, registrations which are supposed to yield new instances will not autowire classes for which a circular dependency is detected. A new instance will be resolved but the instance's members will not be autowired. -* Resolving a class registered by supertype or interface will only autowire the members inherited from its supertypes and in the case of interfaces none at all. +* Resolving a class registered by supertype or interface will only autowire the members inherited from its supertypes and in the case of interfaces none at all. A workaround for this issue is to autowire members in the constructor of a class: +```d +class ComponentF { + @Autowire + public ComponentA componentA; + + public this() { + auto container = Container.getInstance(); + container.autowire!ComponentF(this); + } +} +``` Future Work -----------