Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Singleton Class in Asp.net application

Singleton Class in Asp.net application

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rafique Abdullah
    wrote on last edited by
    #1

    Hi there, I am new to asp.net :) . I want to use a singleton class in asp.net application. Scenario is as following: A user from GroupA and some users from GroupB login to application. I want to use a singleton class to keep info of all logged in users in above scenario. So i can exchange information/data among users through that class. Is that possible:confused:? Assuming that most users will be logged in at same time or fixed time interval. Thanks.

    N 1 Reply Last reply
    0
    • R Rafique Abdullah

      Hi there, I am new to asp.net :) . I want to use a singleton class in asp.net application. Scenario is as following: A user from GroupA and some users from GroupB login to application. I want to use a singleton class to keep info of all logged in users in above scenario. So i can exchange information/data among users through that class. Is that possible:confused:? Assuming that most users will be logged in at same time or fixed time interval. Thanks.

      N Offline
      N Offline
      Nathan Minier
      wrote on last edited by
      #2

      What is it you're asking exactly? Are you asking how to implement a singleton, or if a monolithic session tracker/message bus is a good idea (it's not)?

      "There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli

      R 1 Reply Last reply
      0
      • N Nathan Minier

        What is it you're asking exactly? Are you asking how to implement a singleton, or if a monolithic session tracker/message bus is a good idea (it's not)?

        "There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli

        R Offline
        R Offline
        Rafique Abdullah
        wrote on last edited by
        #3

        Thanks 4 ur reply. I know how to implement and use singleton class. I want to know, will it work in my scenario?

        F 1 Reply Last reply
        0
        • R Rafique Abdullah

          Thanks 4 ur reply. I know how to implement and use singleton class. I want to know, will it work in my scenario?

          F Offline
          F Offline
          F ES Sitecore
          wrote on last edited by
          #4

          It will work as long as all users are accessing the site in the same app domain, so on a single machine you'll be ok but your solution won't scale. You'll need to consider threading issues too as the same objects will be being read\written at the same time.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups