Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7168735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:50:23+00:00 2026-05-28T14:50:23+00:00

I am developing a generic layer that allows me to perform the basic save,

  • 0

I am developing a generic layer that allows me to perform the basic save, delete and load operations however came across a point which I don’t know the answer too and thought instantly of StackOverflow.

I have an asp.net app which references a seperate project (Business Layer which contains all my class definitions). One of my classes (ObjectFactory) takes care of instantiating objects and stores them in a static dictionary (privately). The idea being that if its already been instantiated it will retrieve its definition from the static collection. I have chosen to do this because I only want to get the propertyinfo[] of a class once as according to an MSDN article by Joel Pobar getting this information is quite expensive.

My question is, although the asp.net project references my class library which contains all my business logic, will this static collection be available globally? For example, if two users are concurrently on my site and access two seperate parts of my website which involves instantiating two seperate objects will the cache in ObjectFactory contain both items? Or is the static collection on a per user basis, i.e. the static collection will only contain items for a particular user?

As my business layer doesn’t have access to the web cache I am unsure of whether to make my business layer reference System.Web and then insert into it?

Sorry if I may have confused anyone but I am more than happy to provide further info if required too.

Thanks in advance, Onam.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:50:24+00:00Added an answer on May 28, 2026 at 2:50 pm

    In addition to @Steven’s answer, I would add that the static collection will be emptied every time the application pool recycles, and if you end up running on multiple servers, each one will have it’s own collection.

    So in addition to making the items in the dictionary thread safe, you should use ConcurrentDictionary and it’s GetOrAdd and AddOrUpdate methods to ensure thread-safe access to the dictionary itself, rtaher than the plain Dictionary class, which is not thread safe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C program that I'm developing using Ubuntu 11.10 (Linux version 3.0.0-12-generic-pae
I'm developing a web app that emulates a generic file browser for the desktop,
I'm developing my own Eclipse plugin and came across a very strange behavior. In
I am developing a cache for generic types and have a doubt, should I
I am developing a generic wrapper around TryParse, as follows: public delegate bool ParseDelegate<T>(string
I'm developing an application both for Iphone and Andriod using Phonegap. I came up
I am developing a website that requires tagging up different types of content, which
Developing an interface generic I wished to declare a constructor in an interface but
I'm currently developing a program in python and I just noticed that something was
While developing software, developers always tend to curse about some language specifics, improvements that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.