"MikeSwann" <(E-Mail Removed)> a écrit dans le message de news:
4A68D408-2BC6-4165-B063-(E-Mail Removed)...
| I am thinking about using the Dictionary Class, however should I be
| inherting the class and exposing the base methods (ie base.Add) or should
I
| be creating a local dictionary variable and then exposing the local
methods
| (ie localDictionary.Add).
If you are wanting a "lookup" based on a key, then you certainly need a
Dictionary. The question remains, which version of .NET are you working
with, as this decides whether you use a generic collection or not.
| It's more the theory of OO that I am struggling with I think!
You would never normally inherit from a list class in order to create a
container class. Instead you would use either Aggregation or Composition.
The choice is down to whether the containing class "owns" the items in the
list.
Composition means the contained items are owned by the containing class.
They have no context outside of the containing class; they are created,
managed and destroyed only from within the containing class.
Aggregation means that the items in the list have their own lives outside of
the containing class. The list is essntially a list of references to
instances of other classes.
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer