c# - Design for interface that can be "implemented N times" -


currently i'm using generic interface declare ioc dependencies this:

public interface icomposition<t> {   t dependency { get; set; } } 

but happens implementations have more 1 dependency @ same time.

i know it's ridiculous, guys understand need... let's implement interface multiple times solve problem:

public class myclass : icomposition<typea>, icomposition<typeb> {   ... } 

i believe using icomposition<t1, t2, ...> or 1 itypexdependent each type aren't options. core needs resolve dependencies @ runtime using reflection. so, thats why i'm not passing dependencies through constructor.

does know trick can me out?

i use constructor parameters instead of current scheme set dependencies:

public class myclass {     public void myclass(typea a, typeb b)     {         ....     } } 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -