I have a list of
IReader that I read at the beginning of my program. Later on I need
ReaderFactory to get appropriate
IReader based on
Extensions it can use. The problem is the factory needs to know about available readers. So I have two options:
- Make static
static Get(string extension)and
static Init(IEnumerable<IReader> readers)which would be called somewhere in my starting class.
IReaderFactorywith constructor and
private IEnumerable<IReader> _readersand make an instance of this and pass it via
My question is which one would you use in this particular situation? Also maybe there is a third option that I don't know about?