- A Step Toward Realism
- Overview
- New Architecture Code Examples
- The Usual Type of Client-Side Code
- A Couple of Tweaks that Help Performance
- Collapsed Objects
- Statuses in One Single Byte
- Object Vector
- NonSerialized()
- Using "Dumb" Collections
- Another Struggle with Guids
- Oops, Maintainability Must Be Lost!
- And a Few Tweaks Not Applied Yet
- A New Test Application
- Results of the Throughput Tests
- Conclusion
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.