User-defined classes in Global.asa

Discussion in 'ASP General' started by Brad, Nov 9, 2004.

  1. Brad

    Brad Guest

    Hi,

    I've read that one shouldn't include ADO objects in the Global.asa for the
    sake of performance, but would user-defined classes cause the same kind of
    performance hit? Assuming that they wouldn't, is it possible to do it?

    I can't seem to figure out how to include them, nor find any reference to it
    in msdn.

    Is there a way to do this? Or should I create a slew of Session variables?
    Yuck.

    <script language='VBScript' runat='server'>
    public obj
    class Something
    public Name
    public Value
    Sub Class_Initialize()
    Name = "Joe"
    Value = "Blow"
    end Sub
    End class
    Sub Session_OnStart()
    ' This won't work
    set obj = new Something
    ' Either will this
    set Session("obj") = new Something
    End Sub
    </script>

    Thanks.
     
    Brad, Nov 9, 2004
    #1
    1. Advertising

  2. Brad wrote:
    > Hi,
    >
    > I've read that one shouldn't include ADO objects in the Global.asa
    > for the sake of performance, but would user-defined classes cause the
    > same kind of performance hit? Assuming that they wouldn't, is it
    > possible to do it?
    >
    > I can't seem to figure out how to include them, nor find any
    > reference to it in msdn.
    >
    > Is there a way to do this? Or should I create a slew of Session
    > variables? Yuck.
    >
    > <script language='VBScript' runat='server'>
    > public obj
    > class Something
    > public Name
    > public Value
    > Sub Class_Initialize()
    > Name = "Joe"
    > Value = "Blow"
    > end Sub
    > End class
    > Sub Session_OnStart()
    > ' This won't work
    > set obj = new Something
    > ' Either will this
    > set Session("obj") = new Something
    > End Sub
    > </script>
    >
    > Thanks.


    http://groups.google.com/groups?hl=en&lr=&c2coff=1&selm=#jlR#2xH$GA.231@cppssbbsa05


    http://groups.google.com/groups?hl=...vbscript+class+in+asp+application&btnG=Search

    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Nov 9, 2004
    #2
    1. Advertising

  3. Brad

    Brad Guest

    Thanks Bob.

    "Bob Barrows [MVP]" wrote:

    > Brad wrote:
    > > Hi,
    > >
    > > I've read that one shouldn't include ADO objects in the Global.asa
    > > for the sake of performance, but would user-defined classes cause the
    > > same kind of performance hit? Assuming that they wouldn't, is it
    > > possible to do it?
    > >
    > > I can't seem to figure out how to include them, nor find any
    > > reference to it in msdn.
    > >
    > > Is there a way to do this? Or should I create a slew of Session
    > > variables? Yuck.
    > >
    > > <script language='VBScript' runat='server'>
    > > public obj
    > > class Something
    > > public Name
    > > public Value
    > > Sub Class_Initialize()
    > > Name = "Joe"
    > > Value = "Blow"
    > > end Sub
    > > End class
    > > Sub Session_OnStart()
    > > ' This won't work
    > > set obj = new Something
    > > ' Either will this
    > > set Session("obj") = new Something
    > > End Sub
    > > </script>
    > >
    > > Thanks.

    >
    > http://groups.google.com/groups?hl=en&lr=&c2coff=1&selm=#jlR#2xH$GA.231@cppssbbsa05
    >
    >
    > http://groups.google.com/groups?hl=...vbscript+class+in+asp+application&btnG=Search
    >
    > Bob Barrows
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >
    >
     
    Brad, Nov 10, 2004
    #3
  4. "Brad" <> wrote in message
    news:...
    > Hi,
    >
    > I've read that one shouldn't include ADO objects in the Global.asa for the
    > sake of performance,


    One should not store ADO objects on Session or Application variables. I see
    no reason not to use them in the Global.asa file.


    > but would user-defined classes cause the same kind of
    > performance hit? Assuming that they wouldn't, is it possible to do it?
    >
    > I can't seem to figure out how to include them, nor find any reference to

    it
    > in msdn.
    >
    > Is there a way to do this? Or should I create a slew of Session

    variables?
    > Yuck.
    >
    > <script language='VBScript' runat='server'>
    > public obj
    > class Something
    > public Name
    > public Value
    > Sub Class_Initialize()
    > Name = "Joe"
    > Value = "Blow"
    > end Sub
    > End class
    > Sub Session_OnStart()
    > ' This won't work
    > set obj = new Something
    > ' Either will this
    > set Session("obj") = new Something
    > End Sub
    > </script>
    >
    > Thanks.
     
    Stephanie Stowe, Nov 10, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darlene Gauthier

    PostRequestHandlerExecute event in global.asa

    Darlene Gauthier, Jul 23, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,427
    Karl Seguin
    Jul 23, 2003
  2. Wayne
    Replies:
    2
    Views:
    478
    Wayne
    Nov 11, 2003
  3. Oodini
    Replies:
    1
    Views:
    1,786
    Keith Thompson
    Sep 27, 2005
  4. Replies:
    1
    Views:
    509
    Sion Arrowsmith
    Jul 10, 2008
  5. Daniel L.

    GLOBAL.ASA real active user count

    Daniel L., Oct 8, 2003, in forum: ASP General
    Replies:
    2
    Views:
    150
    Manohar Kamath [MVP]
    Oct 8, 2003
Loading...

Share This Page