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. DAC and SingleTon pattern

DAC and SingleTon pattern

Scheduled Pinned Locked Moved ASP.NET
designregexarchitectureperformancequestion
6 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.
  • S Offline
    S Offline
    Satish32
    wrote on last edited by
    #1

    Does a Data Access Component has any impact on the Web application performance if it is designed using SingleTon design pattern?

    Satish

    A 1 Reply Last reply
    0
    • S Satish32

      Does a Data Access Component has any impact on the Web application performance if it is designed using SingleTon design pattern?

      Satish

      A Offline
      A Offline
      Ashutosh Phoujdar
      wrote on last edited by
      #2

      Can you please put some more details about how you are implementing web application using Singleton pattern? :)

      dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

      S 1 Reply Last reply
      0
      • A Ashutosh Phoujdar

        Can you please put some more details about how you are implementing web application using Singleton pattern? :)

        dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

        S Offline
        S Offline
        Satish32
        wrote on last edited by
        #3

        DAC is implemented in sigleton pattern not the webapp. My concern is when DAC is singleton, single instance will be shared across all the session. When single instance is being served by one user request and other user is trying for it should second user need to wait for it to get access? I am totally confused how it will share the single instance across all the session. If the single instance serve each user request sequentially one after other, application will become slow, or mybe i am thinking completely wrong way. Please clarify me, Thanks in advance

        Satish

        modified on Thursday, January 29, 2009 3:42 AM

        S A 2 Replies Last reply
        0
        • S Satish32

          DAC is implemented in sigleton pattern not the webapp. My concern is when DAC is singleton, single instance will be shared across all the session. When single instance is being served by one user request and other user is trying for it should second user need to wait for it to get access? I am totally confused how it will share the single instance across all the session. If the single instance serve each user request sequentially one after other, application will become slow, or mybe i am thinking completely wrong way. Please clarify me, Thanks in advance

          Satish

          modified on Thursday, January 29, 2009 3:42 AM

          S Offline
          S Offline
          SeMartens
          wrote on last edited by
          #4

          Hi, it depends how your DAC is implemented. If you are using thread-synchronization methods (like locks, Monitors etc.) then your DAC does not support multiple requests at once. This will force the second user to wait until the first one is done using the DAC (depends really on the implementation). If you didn't use synchronization methods, then your DAC can be accessed by multiple users at the same time. Singleton only means that you are using one single instance on a class. It doesn't say anything about multi-threading. But if you use a singleton in a multi-threaded environment (like a webserver) you have to pay attention that multi-threading is not a problem for your DAC (side-effects). Singleton is a design-pattern <-> serving one request at a time is a threading issue. Hope this helps a bit. Regards Sebastian

          It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

          S 1 Reply Last reply
          0
          • S SeMartens

            Hi, it depends how your DAC is implemented. If you are using thread-synchronization methods (like locks, Monitors etc.) then your DAC does not support multiple requests at once. This will force the second user to wait until the first one is done using the DAC (depends really on the implementation). If you didn't use synchronization methods, then your DAC can be accessed by multiple users at the same time. Singleton only means that you are using one single instance on a class. It doesn't say anything about multi-threading. But if you use a singleton in a multi-threaded environment (like a webserver) you have to pay attention that multi-threading is not a problem for your DAC (side-effects). Singleton is a design-pattern <-> serving one request at a time is a threading issue. Hope this helps a bit. Regards Sebastian

            It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

            S Offline
            S Offline
            Satish32
            wrote on last edited by
            #5

            Thanks Sebastian, this answer means a lot to me

            Satish

            1 Reply Last reply
            0
            • S Satish32

              DAC is implemented in sigleton pattern not the webapp. My concern is when DAC is singleton, single instance will be shared across all the session. When single instance is being served by one user request and other user is trying for it should second user need to wait for it to get access? I am totally confused how it will share the single instance across all the session. If the single instance serve each user request sequentially one after other, application will become slow, or mybe i am thinking completely wrong way. Please clarify me, Thanks in advance

              Satish

              modified on Thursday, January 29, 2009 3:42 AM

              A Offline
              A Offline
              Ashutosh Phoujdar
              wrote on last edited by
              #6

              satz32 wrote:

              My concern is when DAC is singleton, single instance will be shared across all the session.

              This depends if DAC is running in separate Application Domain and serving to multiple application instance via Web Service or any other interoperability methodology. Otherwise every application will have associated DAC running in same application domain, No matter how it is implemented.

              satz32 wrote:

              I am totally confused how it will share the single instance across all the session. If the single instance serve each user request sequentially one after other, application will become slow, or mybe i am thinking completely wrong way.

              You can easily figure out if DAC is running in separate instance by inspecting application architecture.

              dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

              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