Credit reference names implementation question
Posted by
Naoufel El Bachir on
URL: http://quantlib.414.s1.nabble.com/Credit-reference-names-implementation-question-tp10972.html
Hi All,
First I wish you a Happy new year.
Question: I am coding a hierarchy of classes for representing credit reference names, and I am hesitating between two alternatives. I need your opinions.
Both alternatives start with this common structure implemented using the composite pattern:
Abstract base at the root of the hierarchy: CreditReference
Derived from it are SingleReference and BasketReference, where BasketReference is the composite.
Now the question, would you have SingleReference as a concrete class, and every new name would be an instance of it, or would you go with an abstract class with every new name being a concrete class as it is done with currencies. Of course, in the second case I would provide some macros allowing to automate the generation of the code for new names.
Or any other suggestion.
Thanks
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre.