public class MyClass
{
IDataReader reader;
IMessageSender sender;
public MyClass(IDataReader reader = null,
IMessageSender sender = null)
{
this.reader = reader ?? new DefaultDataReader();
this.sender = sender ?? new DefaultMessageSender();
}
}
Does this approach make Poor Man's DI more palatable or should it still be avoided?
No comments:
Post a Comment