mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Change names to be more unified
This commit is contained in:
parent
5037b79998
commit
ae139d5f1f
|
@ -19,8 +19,8 @@ public import poodinis.registration;
|
||||||
public import poodinis.autowire;
|
public import poodinis.autowire;
|
||||||
|
|
||||||
class RegistrationException : Exception {
|
class RegistrationException : Exception {
|
||||||
this(string message, TypeInfo registeredType, TypeInfo_Class instantiatableType) {
|
this(string message, TypeInfo registeredType, TypeInfo_Class concreteType) {
|
||||||
super(format("Exception while registering type %s to %s: %s", registeredType.toString(), instantiatableType.name, message));
|
super(format("Exception while registering type %s to %s: %s", registeredType.toString(), concreteType.name, message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,13 +47,13 @@ class DependencyContainer {
|
||||||
|
|
||||||
public Registration register(InterfaceType, ConcreteType : InterfaceType)() {
|
public Registration register(InterfaceType, ConcreteType : InterfaceType)() {
|
||||||
TypeInfo registeredType = typeid(InterfaceType);
|
TypeInfo registeredType = typeid(InterfaceType);
|
||||||
TypeInfo_Class instantiatableType = typeid(ConcreteType);
|
TypeInfo_Class concreteType = typeid(ConcreteType);
|
||||||
|
|
||||||
debug {
|
debug {
|
||||||
writeln(format("DEBUG: Register type %s (as %s)", instantiatableType.toString(), registeredType.toString()));
|
writeln(format("DEBUG: Register type %s (as %s)", concreteType.toString(), registeredType.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Registration newRegistration = new Registration(registeredType, instantiatableType);
|
Registration newRegistration = new Registration(registeredType, concreteType);
|
||||||
newRegistration.singleInstance();
|
newRegistration.singleInstance();
|
||||||
registrations[registeredType] = newRegistration;
|
registrations[registeredType] = newRegistration;
|
||||||
return newRegistration;
|
return newRegistration;
|
||||||
|
|
Loading…
Reference in a new issue