Talk:Collection of Collections Is a Code Smell

From WikiContent

Why not name the CompoundKey by its DomainName i.e. Name. And indexing persons to FirstName, LastName is just one view on a PeopleList. That generic List for people could have different projections for different views (indices) that use their own indexing. e.g. something like this (just typed in here not thrown at a compiler)

Nice review. I don't want to use Generics for a number of reasons. The foremost reason is that it distracts from my main point which still applies with or without the use of generics. Also, this code differs in functionality from the code that I'm using in my example. The use of and performance penalty of using an iterator is unnecessary. I can also argue against the use of Generics in this case with the claim that designing with generics robs you of a home for behaviors that are associated with the relationships and other state that would be expressed in the missing design element (the missing class).

Kevlin pointed out a second point, CompoundKey. Ok, well whats in a name ;-). It is a technical object that represents a kind of CompositeKey. So, I guess I could have named it PersonNameCompositeKey signifying its specialization.