G
Guest
Dear All,
I am trying to decide on to create a collection object for a project that I
am working on. I am fairly new to OOP so this may be on the basic side. I
have looked on the groups, but can't seem to find the answer I am looking for
- just more questions!
I want an object to hold Case details, one of the properties of this Case
class will be RequestedBy. I ideally want this property to be a collection
of User Objects (which will contain name, telephone, department etc).
My thinking is that I would have a Class Case with a property of RequestedBy
(of type Users) and the Users collection will have an indeterminate number of
User objects.
What is the best way for me to create the Users collection? From what I
have read I can either:
Create my own Collection by implementing the IEnumerable/IEnumerator interface
OR
Implement a pre-written Collection Interface for example IDictionary
OR
Implement the Class, for example Dictionary and my calls to base.Add for
example.
Is there a preferred way to do this? It seems to be such a fundamental
thing to do and whilst there is a great deal of information on the different
methods, there doesn't seem to be anything on how and when to use different
strategies.
I look forward to any help!
Regards
Mike Swann
I am trying to decide on to create a collection object for a project that I
am working on. I am fairly new to OOP so this may be on the basic side. I
have looked on the groups, but can't seem to find the answer I am looking for
- just more questions!
I want an object to hold Case details, one of the properties of this Case
class will be RequestedBy. I ideally want this property to be a collection
of User Objects (which will contain name, telephone, department etc).
My thinking is that I would have a Class Case with a property of RequestedBy
(of type Users) and the Users collection will have an indeterminate number of
User objects.
What is the best way for me to create the Users collection? From what I
have read I can either:
Create my own Collection by implementing the IEnumerable/IEnumerator interface
OR
Implement a pre-written Collection Interface for example IDictionary
OR
Implement the Class, for example Dictionary and my calls to base.Add for
example.
Is there a preferred way to do this? It seems to be such a fundamental
thing to do and whilst there is a great deal of information on the different
methods, there doesn't seem to be anything on how and when to use different
strategies.
I look forward to any help!
Regards
Mike Swann