From d888d0a80847c8a0b8b3e3f1705548d362f0b63b Mon Sep 17 00:00:00 2001 From: Mike Bierlee Date: Thu, 24 Dec 2015 18:58:34 +0100 Subject: [PATCH] Rename instantiatableType -> instanceType --- source/poodinis/container.d | 2 +- source/poodinis/context.d | 2 +- source/poodinis/registration.d | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/poodinis/container.d b/source/poodinis/container.d index 177c8d2..7ed61fa 100644 --- a/source/poodinis/container.d +++ b/source/poodinis/container.d @@ -187,7 +187,7 @@ synchronized class DependencyContainer { private Registration getRegistration(Registration[] candidates, TypeInfo concreteType) { foreach(existingRegistration ; candidates) { - if (existingRegistration.instantiatableType == concreteType) { + if (existingRegistration.instanceType == concreteType) { return existingRegistration; } } diff --git a/source/poodinis/context.d b/source/poodinis/context.d index 1b5aecb..195cb3b 100644 --- a/source/poodinis/context.d +++ b/source/poodinis/context.d @@ -34,7 +34,7 @@ public void registerContextComponents(ApplicationContextType : ApplicationContex static if (hasUDA!(__traits(getMember, context, member), Component)) { auto factoryMethod = &__traits(getMember, context, member); auto registration = container.register!(ReturnType!factoryMethod); - registration.instanceFactory = new InstanceFactory(registration.instantiatableType, CreatesSingleton.yes, null, factoryMethod); + registration.instanceFactory = new InstanceFactory(registration.instanceType, CreatesSingleton.yes, null, factoryMethod); } } } diff --git a/source/poodinis/registration.d b/source/poodinis/registration.d index 7759b02..a538777 100644 --- a/source/poodinis/registration.d +++ b/source/poodinis/registration.d @@ -29,22 +29,22 @@ class InstanceCreationException : Exception { class Registration { private TypeInfo _registeredType = null; - private TypeInfo_Class _instantiatableType = null; + private TypeInfo_Class _instanceType = null; private Registration linkedRegistration; public @property registeredType() { return _registeredType; } - public @property instantiatableType() { - return _instantiatableType; + public @property instanceType() { + return _instanceType; } public InstanceFactory instanceFactory = null; - this(TypeInfo registeredType, TypeInfo_Class instantiatableType) { + this(TypeInfo registeredType, TypeInfo_Class instanceType) { this._registeredType = registeredType; - this._instantiatableType = instantiatableType; + this._instanceType = instanceType; } public Object getInstance(InstantiationContext context = new InstantiationContext()) { @@ -111,7 +111,7 @@ class InstanceFactory { * Effectively makes the given registration a singleton. */ public Registration singleInstance(Registration registration) { - registration.instanceFactory = new InstanceFactory(registration.instantiatableType, CreatesSingleton.yes, null); + registration.instanceFactory = new InstanceFactory(registration.instanceType, CreatesSingleton.yes, null); return registration; } @@ -119,7 +119,7 @@ public Registration singleInstance(Registration registration) { * Scopes registrations to return a new instance every time the given registration is resolved. */ public Registration newInstance(Registration registration) { - registration.instanceFactory = new InstanceFactory(registration.instantiatableType, CreatesSingleton.no, null); + registration.instanceFactory = new InstanceFactory(registration.instanceType, CreatesSingleton.no, null); return registration; } @@ -127,7 +127,7 @@ public Registration newInstance(Registration registration) { * Scopes registrations to return the given instance every time the given registration is resolved. */ public Registration existingInstance(Registration registration, Object instance) { - registration.instanceFactory = new InstanceFactory(registration.instantiatableType, CreatesSingleton.yes, instance); + registration.instanceFactory = new InstanceFactory(registration.instanceType, CreatesSingleton.yes, instance); return registration; } @@ -137,7 +137,7 @@ public string toConcreteTypeListString(Registration[] registrations) { if (concreteTypeListString.length > 0) { concreteTypeListString ~= ", "; } - concreteTypeListString ~= registration.instantiatableType.toString(); + concreteTypeListString ~= registration.instanceType.toString(); } return concreteTypeListString; }