How to put constraint on constructor parameters?
Is it a good practice?
I have an interface, and I would require Logger component (to be injected by unity).
How can it be enforced that all derived classes would have Logger component (ILogger) as a parameter?
I could not find any appropriate solution.
Only workaround I have found is to put method Initialize (<parameters>) in the interface. This is an ugly approach, and requires special handling.
Is there any design pattern that address such problems?
Initializemethod accepting whatever these components need to have. That's the standard approach to this problem anyway.