Results 1 to 2 of 2

Thread: GobalMutliUse Instancing vs. GlobalSingleUse

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    45

    Question

    My documentation for VB says this about GlobalSingleUse Objects:

    "For out of process components only, you can set the instancing property of a class module to GlobalSingleUse. If you do this, a separate instance of your component will be loaded into memory for each client. This requires a lot more memory than providing GlobalMultiUse objects"

    Then earlier for GlobalMultiUse it says:

    "Each client that uses the properties and methods of a GlobalMultiUse class gets its own instance of the class. In other words, the "Global" in GlobalMultiUse does not mean "one global instance that all clients share".

    I know that the "global" means. IT is a reference to scope so that the classes who objects you use don't have to be explicitely created to use the objects contained therein.

    However, I don't see a difference between MultiUse and SingleUse. (Is it a threading thingy?).

    Thanks.
    -Gregg
    -NoOBie At LaRg3

  2. #2
    Guest

    here is the answer

    the difference between GlobalMultiUser and GlobalSingleUser is:
    by GlobalSingleUser get every Client his own Instance
    by GlobalMultiUser the first client create an Instance of the Object, all other clients get only a new thread of the object.

    difference between GlobalMultiUser and MultiUser

    if you have a class with GlobalMultiUser you don't need to declare the class. Example

    Private Sub cmdCalculateResult_Click()
    txtResult.Text = LeastReasonableReturn(CCur(txtBeginningBalance.Text))
    End Sub

    By MultiUser:

    Private Sub cmdCalculateResult_Click()
    Dim gfins as New Financials

    txtResult.Text = gfins.LeastReasonableReturn(CCur(txtBeginningBalance.Text))

    set gfins=nothing
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width