User-defined classes in Global.asa

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brad

    User-defined classes in Global.asa

    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='VBScr ipt' runat='server'>
    public obj
    class Something
    public Name
    public Value
    Sub Class_Initializ e()
    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.
  • Bob Barrows [MVP]

    #2
    Re: User-defined classes in Global.asa

    Brad wrote:[color=blue]
    > 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='VBScr ipt' runat='server'>
    > public obj
    > class Something
    > public Name
    > public Value
    > Sub Class_Initializ e()
    > 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.[/color]






    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"


    Comment

    • Brad

      #3
      Re: User-defined classes in Global.asa

      Thanks Bob.

      "Bob Barrows [MVP]" wrote:
      [color=blue]
      > Brad wrote:[color=green]
      > > 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='VBScr ipt' runat='server'>
      > > public obj
      > > class Something
      > > public Name
      > > public Value
      > > Sub Class_Initializ e()
      > > 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.[/color]
      >
      > http://groups.google.com/groups?hl=e...%40cppssbbsa05
      >
      >
      > http://groups.google.com/groups?hl=e...6btnG%3DSearch
      >
      > 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"
      >
      >
      >[/color]

      Comment

      • Stephanie Stowe

        #4
        Re: User-defined classes in Global.asa


        "Brad" <Brad@discussio ns.microsoft.co m> wrote in message
        news:55039DCE-5C96-4625-965E-6DAA931DDF85@mi crosoft.com...[color=blue]
        > Hi,
        >
        > I've read that one shouldn't include ADO objects in the Global.asa for the
        > sake of performance,[/color]

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

        [color=blue]
        > 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[/color]
        it[color=blue]
        > in msdn.
        >
        > Is there a way to do this? Or should I create a slew of Session[/color]
        variables?[color=blue]
        > Yuck.
        >
        > <script language='VBScr ipt' runat='server'>
        > public obj
        > class Something
        > public Name
        > public Value
        > Sub Class_Initializ e()
        > 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.[/color]


        Comment

        Working...