Re: Credit reference names implementation question

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Credit-reference-names-implementation-question-tp10972p10973.html

On 01/04/2006 06:07:40 PM, Naoufel El Bachir wrote:
>  First I wish you a Happy new year.

Thank you.

>  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.

Hmm. It might depend. What would the interface of CreditReference look  
like?

Later,
        Luigi


----------------------------------------

There are no rules of architecture for a castle in the clouds.
-- Gilbert K. Chesterton