Unity auto registration(marcinbudny.blogspot.com)
submitted by
Nextender(20) 2 years, 6 months ago
Auto registration is a great feature for any Dependency Injection container. Suppose you decided to implement the Domain Event pattern. So you have a bunch of events and some event handlers. These event handlers are classes implementing some common interface, say IHandlerFor<TEvent>. You also have a central registry of these handlers, so that you can easily find handlers for particular event – and run them passing the event data. But how does the registry know about these handlers? Well, you probably have to register all of them in the registry with some kind of configuration code.
|category: C#
|Views: 20
tags:
C# another
Everyones tags:
Your Tags: