I like the Stream
hierarchy. The idea is that anything can use a stream without usually caring what kind of stream it is, and individual subclasses handle the storage differently (e.g. NetworkStream
, MemoryStream
and FileStream
in .NET).
If you’re interested in interfaces, then IEnumerable<T>
in .NET is a great one – you can iterate over any collection without caring what the underlying data structure is.