What would the difference be between the following two:
public class Foo : IList<string>
{
...
}
public class Foo : List<string>
{
...
}
Thanks,
Tom P.
Adam Clauss - 24 Jul 2008 19:53 GMT
In the first one, Foo would have to manually implement all the members
defined by IList<string>.
In the second one, Foo would already come complete with all the
implementation that exists in List<string>, and you could just add
additional functionality on top of it.

Signature
Adam Clauss
> What would the difference be between the following two:
>
[quoted text clipped - 10 lines]
> Thanks,
> Tom P.
Arne Vajhøj - 24 Jul 2008 21:53 GMT
> What would the difference be between the following two:
>
[quoted text clipped - 7 lines]
> ...
> }
The first only inherit the interface. The second inherit
only the interface and the implementation.
But I would be careful with the second - it is easy to
become coupled with the internals of List.
Arne