Home > Articles > Programming > Windows Programming

  • Print
  • + Share This
From the author of

Using "Dumb" Collections

When I started the work with the new architecture, I let the collections maintain information about the instances, such as whether any of the instances were dirty or not. To make that work, I had to let the instances tell the collections about it. Unfortunately, it proved very slow to use AddHandler to let the collection receive events from the instances. Instead, I used an old-fashioned callback, but I decided later that it wasn't really needed in my applications, so I save a bit in serialization size, too. It also makes serialization much cleaner. As a matter of fact, I actually use ArrayList quite a lot instead of my custom collections. It saves on dumb code that has to be written, but it also makes it problematic to go for cool tweaks with custom serialization in the future. But when necessary, of course, I can always shift to custom collection classes instead.

  • + Share This
  • 🔖 Save To Your Account