Rename RegistationScope -> CreationScope

This commit is contained in:
Mike Bierlee 2014-05-21 00:27:38 +02:00
parent cbecebf43f
commit 7d1fe2deda

View file

@ -3,7 +3,7 @@ module poodinis.registration;
class Registration { class Registration {
TypeInfo registeredType = null; TypeInfo registeredType = null;
TypeInfo_Class instantiatableType = null; TypeInfo_Class instantiatableType = null;
RegistrationScope registationScope = null; CreationScope registationScope = null;
this(TypeInfo registeredType, TypeInfo_Class instantiatableType) { this(TypeInfo registeredType, TypeInfo_Class instantiatableType) {
this.registeredType = registeredType; this.registeredType = registeredType;
@ -25,17 +25,17 @@ class NoScopeDefinedException : Exception {
} }
} }
interface RegistrationScope { interface CreationScope {
public Object getInstance(); public Object getInstance();
} }
class NullScope : RegistrationScope { class NullScope : CreationScope {
public Object getInstance() { public Object getInstance() {
return null; return null;
} }
} }
class SingleInstanceScope : RegistrationScope { class SingleInstanceScope : CreationScope {
TypeInfo_Class instantiatableType = null; TypeInfo_Class instantiatableType = null;
Object instance = null; Object instance = null;
@ -57,7 +57,7 @@ public Registration singleInstance(Registration registration) {
return registration; return registration;
} }
class NewInstanceScope : RegistrationScope { class NewInstanceScope : CreationScope {
TypeInfo_Class instantiatableType = null; TypeInfo_Class instantiatableType = null;
this(TypeInfo_Class instantiatableType) { this(TypeInfo_Class instantiatableType) {
@ -74,7 +74,7 @@ public Registration newInstance(Registration registration) {
return registration; return registration;
} }
class ExistingInstanceScope : RegistrationScope { class ExistingInstanceScope : CreationScope {
Object instance = null; Object instance = null;
this(Object instance) { this(Object instance) {