Imagine there is an interface IPriceProvider which supposed to serve 2 needs: historical and latest. So I think we have 2 options here.First:PriceInfo GetLatestPrice(string symbol);PriceInfo GetHistoricalPrice(string symbol, DateTime pointInTime);Second:PriceInfo GetPrice(string symbol, DateTime pointInTime);In my opinion the second one is better, cause it's more flexible. Imagine, you have a Report which is as of now - so it calls this price provider like this:GetPrice(EURUSD, _dateTime.Now);So if there is a task to show what this exact report was showing yesterday at 17:35, I will just set _dateTime.Now to that point and my report will just work. But in case of the first approach, where I call it this way:GetLatestPrice(EURUSD);I will need to have a second implementation of IPriceProvider, then I will have wiring issue, I will need to configure my DI container in a special way and so on...Am I missing something?What are the Pros and Cons in these 2 approaches?Update:The Report class might look like this:public class Report{    private readonly IDateTime _dateTime;    private readonly IPriceProvider _priceProvider;    public Report(IDateTime dateTime, IPriceProvider priceProvider)    {       _dateTime = dateTime;       _priceProvider = priceProvider;    }    public void Run()    {        var latestPrice = _priceProvider.GetPrice(EURUSD, _dateTime.Now);        // do the report calc here    }}
Interface declaration - latest vs historical
design;object oriented design