Credit reference names implementation question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Credit reference names implementation question

Naoufel El Bachir

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.
Reply | Threaded
Open this post in threaded view
|

Re: Credit reference names implementation question

Luigi Ballabio
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