c# - Static vs member field revisited, need advice -


i need advice on piece of functionality ought implement. scenario haven httphandler servers intercept file uploads. in handler, need persist large dictionary of strings inside memory. dictionary might large 100 entries. wondering whether safe store in static variable, not initialized every time instance of handler created (there lot of instance sure). in general, approach in such scenarios. better idea use static fields, persist data not changed?

100 items in dictionary isn't big - in fact, barely getting size hashing faster linear search. if never change once initialized, static may work - try have other abstraction between static , instance - example "context" or "configuration" class can pass instances need it. can have multiple parallel configurations (if need), related instances can share context/configuration - no duplication.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -