I'm using asp.net (c#). I have a factory that uses a dictionary of keys that are mapped to objects types. I originally used a static variable to track the dictionary but realized it would be shared among all sessions. Then I'm left with the idea of passing the object map around everywhere, which seems messy.
Should object maps or other contextual items get passed around, stored in the session, or should I just create a new instance each time I need one (in the case of non-contextual items)? I'm not using an IoC container. An example of a non-contextual item in my case would be mapping text commands that come in from the client to objects.
In general it seems there is no good way to deal with contextual data without at least having a static object that pulls the values from a session. Otherwise I am stuck with passing tons of context objects around everywhere they are needed. Surely there is a good pattern for handling contexts, object maps, etc. without using session to store everything?