0

I'm interested in an answer that explain the best in each situation.

In particular which is best for:

  • few values
  • lots of values
  • many values with only few extensively used
  • read only or nearly read only map
  • write-a-lot map
  • fast membership without retrieval
  • memory footprint with large value
  • others
Mykelyk
  • 186
  • 2
  • 7

1 Answers1

0

Map/Dictionary object should be used if store less then 100 values and do not store values with more then 100 signs. If you need more, you would better use database storage.

Number of Read/Write operations doesn't matter.

Bogdan Gusiev
  • 8,027
  • 16
  • 61
  • 81
  • Map is an interface, Dictionary is an abstract class, so neither can be instantiated. A HashMap (implements Map) is fine for much higher numbers of values than 100. A Hashtable (extends Dictionary implements Map) is very close to a HashMap, but because its thread-safe is somewhat less efficient. – Jim Ferrans Jun 01 '09 at 06:25
  • 1
    Mykelyk didn't mentioned he is talking about Java. Map and Dictionary is the abstract names that have it's own classes in each programming language. – Bogdan Gusiev Jun 01 '09 at 06:30