Can I drop Map in place of Dictionary? How much refactoring will this require? Will this create any bugs based on expected behavior of Dictionary?

Can I drop Map in place of Dictionary? How much refactoring will this require? Will this create any bugs based on expected behavior of Dictionary?

  • Answer: (Yes, negligible, no).
Map is designed to drop right in place of Dictionary, with no change in runtime behavior. It should be just as performant, and succeed and fail on the same conditions. There are multiple Map classes, so more specifically Map<K, V> replaces Dictionary<K, V>. Map<K, V> is in fact an IDictionary<K, V> (see Best Practices). All Dictionary methods are supported in Map<K, V> (not all are supported in the multi-key maps; specifically, map injection will not be supported). If you are trying to replace Dictionary and have some methods that are not supported (as with multi-key maps), feel free to ask me to upgrade Map to make your work easier.

Last edited Jun 24, 2011 at 8:39 PM by xobzoo, version 9

Comments

No comments yet.