#IServiceProvider
IServiceProvider
So you decided to reinvent the IServiceProvider
Interface :-) which
Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
Your public interface IPandaClass { }
is exactly the same. I guess you forgot to mention that it has the GetHandler
method or otherwise it would be completely meaningless.
Then we read:
This interface is implemented by a class or value type that provides a service to other objects.
This is the missing GetHandler
method.
#Generics vs strings
Generics vs strings
RegisterHandler("messages", Utilities.CreateInstanceOf<MessageHandler>());
Instead of hardcoding strings you could use generics and derive the name from the class name or just use the type as a key.
#Dependency Injection
Dependency Injection
Do you really need all classes in one handler? Have you tried something like Autofac etc.?
#IServiceProvider
So you decided to reinvent the IServiceProvider
Interface :-) which
Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
Your public interface IPandaClass { }
is exactly the same. I guess you forgot to mention that it has the GetHandler
method or otherwise it would be completely meaningless.
Then we read:
This interface is implemented by a class or value type that provides a service to other objects.
This is the missing GetHandler
method.
#Generics vs strings
RegisterHandler("messages", Utilities.CreateInstanceOf<MessageHandler>());
Instead of hardcoding strings you could use generics and derive the name from the class name or just use the type as a key.
#Dependency Injection
Do you really need all classes in one handler? Have you tried something like Autofac etc.?
IServiceProvider
So you decided to reinvent the IServiceProvider
Interface :-) which
Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
Your public interface IPandaClass { }
is exactly the same. I guess you forgot to mention that it has the GetHandler
method or otherwise it would be completely meaningless.
Then we read:
This interface is implemented by a class or value type that provides a service to other objects.
This is the missing GetHandler
method.
Generics vs strings
RegisterHandler("messages", Utilities.CreateInstanceOf<MessageHandler>());
Instead of hardcoding strings you could use generics and derive the name from the class name or just use the type as a key.
Dependency Injection
Do you really need all classes in one handler? Have you tried something like Autofac etc.?
#IServiceProvider
So you decided to reinvent the IServiceProvider
Interface :-) which
Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
Your public interface IPandaClass { }
is exactly the same. I guess you forgot to mention that it has the GetHandler
method or otherwise it would be completenycompletely meaningless.
Then we read:
This interface is implemented by a class or value type that provides a service to other objects.
This is the missing GetHandler
method.
#Generics vs strings
RegisterHandler("messages", Utilities.CreateInstanceOf<MessageHandler>());
Instead of hardcodeshardcoding strings you could use generics and derive the name from the class name or just use the type as a key.
#Dependency Injection
But doDo you really need all classes in one handler? Have you tried something like Autofac etc.?
#IServiceProvider
So you decided to reinvent the IServiceProvider
Interface :-) which
Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
Your public interface IPandaClass { }
is exactly the same. I guess you forgot to mention that it has the GetHandler
method or otherwise it would be completeny meaningless.
Then we read:
This interface is implemented by a class or value type that provides a service to other objects.
This is the missing GetHandler
method.
#Generics vs strings
RegisterHandler("messages", Utilities.CreateInstanceOf<MessageHandler>());
Instead of hardcodes strings you could use generics and derive the name from the class name or just use the type as a key.
#Dependency Injection
But do you really need all classes in one handler? Have you tried something like Autofac etc.?
#IServiceProvider
So you decided to reinvent the IServiceProvider
Interface :-) which
Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
Your public interface IPandaClass { }
is exactly the same. I guess you forgot to mention that it has the GetHandler
method or otherwise it would be completely meaningless.
Then we read:
This interface is implemented by a class or value type that provides a service to other objects.
This is the missing GetHandler
method.
#Generics vs strings
RegisterHandler("messages", Utilities.CreateInstanceOf<MessageHandler>());
Instead of hardcoding strings you could use generics and derive the name from the class name or just use the type as a key.
#Dependency Injection
Do you really need all classes in one handler? Have you tried something like Autofac etc.?
#IServiceProvider
So you decided to reinvent the IServiceProvider
Interface :-) which
Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
Your public interface IPandaClass { }
is exactly the same. I guess you forgot to mention that it has the GetHandler
method or otherwise it would be completeny meaningless.
Then we read:
This interface is implemented by a class or value type that provides a service to other objects.
This is the missing GetHandler
method.
#Generics vs strings
RegisterHandler("messages", Utilities.CreateInstanceOf<MessageHandler>());
Instead of hardcodes strings you could use generics and derive the name from the class name or just use the type as a key.
#Dependency Injection
But do you really need all classes in one handler? Have you tried something like Autofac etc.?