Let's say I have two classes, DNA, SocialSecurityNumber, and
Fingerprint.
There is a one-to-one-to-one relationship between the classes but no
"wired" link between them.
Suppose I want a hashtable, the key being an int that i maintain and
the value being something that holds all three aforementioned objects.
the way i've been doing this is to create a simple class (or struct)
that holds the three:
class DNASSNFPContainer
{
private DNA dna;
private SocialSecurityNumber ssn;
private FingerPrint fp;
public DNASSNFPContainer(DNA dna, SocialSecurityNumber ssn,
FingerPrint fp)
{
this.dna = dna;
this.ssn = ssn;
this.fp = fp;
}
public DNA Dna
{
get
{
return dna;
}
}
public SocialSecurityNumber Ssn
{
get
{
return ssn;
}
}
public FingerPrint Fp
{
get
{
return fp;
}
}
}
this approach feels clunky. instinct tells me that there's a more
elegant way but i can't come up with anything.
thanks in advance.
JT