So, I have a type called FunBond , with a default constructor like this
public FunBond(int id, string name, Currency currency, double notional, DateTime maturityDate, List<CashFlowWithDate> couponCashFlows, DayCounter dayCounter) : base(id, name, notional, InstrumentType.FixedRateBond, currency, maturityDate, dayCounter) { ... }
And DayCounter is an abstract class
public abstract class DayCounter { public abstract string Name(); public abstract double YearFraction(DateTime d1, DateTime d2); public abstract int DayCount(DateTime d1, DateTime d2); }
Now my question is: what should I imagine as a DayCounter to create an instance of FunBond ? I can specify id, name, currency, ... etc. Etc. For passing FunBond as parameters, but what should a DayCounter be? I cannot create an instance of this object, and I cannot provide it with anything that I do not think ... I thought that I would need another class derived from my abstract class to provide FunBond , so I think I misunderstand something fundamentally.
source share