Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • If the type of every player would classify it as belonging to either DefensivePlayers, OffensivePlayers, or OtherPlayers, it might be legitimately useful to have a type which could be used by code which expects a List<Player> but also included members DefensivePlayers, OffsensivePlayers, or SpecialPlayers of type IList<DefensivePlayer>, IList<OffensivePlayer>, and IList<Player>. One could use a separate object to cache the separate lists, but encapsulating them within the same object as the main list would seem cleaner [use the invalidation of a list enumerator...
    – supercat
    Commented Sep 11, 2014 at 20:48
  • ...as a cue for the fact that the main list has changed and the sub-lists will need to be regenerated when they're next accessed].
    – supercat
    Commented Sep 11, 2014 at 20:48
  • 3
    While I agree with the point made, it really tears my soul apart to see someone give design advice and suggest exposing a concrete List<T> with a public getter and setter in a business object :(
    – sara
    Commented Feb 1, 2016 at 9:56