diff --git a/CHANGES.md b/CHANGES.md index d33107a..2194739 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ Poodinis Changelog should not be affected by this change. * ADD application contexts. You can register dependencies within an application context which allow you to fine-tune the creation of dependency instances. * CHANGE all public poodinis imports to private. This should not affect you if you use the package import "poodinis" instead of individual modules. +* REMOVE deprecated ADD_CONCRETE_TYPE_REGISTRATION registration option. **Version 5.0.0** * DEPRECATE ADD_CONCRETE_TYPE_REGISTRATION registration option. It basically does nothing anymore. See next point. diff --git a/source/poodinis/container.d b/source/poodinis/container.d index 49651a7..8d050d3 100644 --- a/source/poodinis/container.d +++ b/source/poodinis/container.d @@ -47,30 +47,6 @@ class RegistrationException : Exception { * Options which influence the process of registering dependencies */ public enum RegistrationOption { - /** - * When registering a type by its supertype, providing this option will also register - * a linked registration to the type itself. - * - * This allows you to resolve that type both by super type and concrete type using the - * same registration scope (and instance managed by this scope). - * - * Examples: - * --- - * class Cat : Animal { ... } - * - * container.register!(Animal, Cat)(RegistrationOptions.ADD_CONCRETE_TYPE_REGISTRATION); - * - * auto firstCat = container.resolve!(Animal, Cat); - * auto secondCat = container.resolve!Cat; - * - * assert(firstCat is secondCat); - * --- - * - * Deprecated: ADD_CONCRETE_TYPE_REGISTRATION behaviour is default now. If you want to reverse to happen, use DO_NOT_ADD_CONCRETE_TYPE_REGISTRATION. - */ - - ADD_CONCRETE_TYPE_REGISTRATION, - /** * Prevent a concrete type being registered on itself. With this option you will always need * to use the supertype as the type of the dependency. diff --git a/test/poodinis/containertest.d b/test/poodinis/containertest.d index 67d7e52..663777b 100644 --- a/test/poodinis/containertest.d +++ b/test/poodinis/containertest.d @@ -494,17 +494,6 @@ version(unittest) { assert(expectedTestClass is actualTestClass, "Instance resolved in main thread is not the one resolved in thread"); } - // Test registering type with option ADD_CONCRETE_TYPE_REGISTRATION - unittest { - shared(DependencyContainer) container = new DependencyContainer(); - container.register!(TestInterface, TestClass)(RegistrationOption.ADD_CONCRETE_TYPE_REGISTRATION); - - auto firstInstance = container.resolve!TestInterface; - auto secondInstance = container.resolve!TestClass; - - assert(firstInstance is secondInstance); - } - // Test registering type with option DO_NOT_ADD_CONCRETE_TYPE_REGISTRATION unittest { shared(DependencyContainer) container = new DependencyContainer();