Professional Web Applications Themes

Classes defined in ASP pages -- desirable? - ASP Components

Is this ever desirable? I always thought it was a bad idea because the class isn't compiled, you can't use MTS/ COM+ etc. But the guy who developed the app I am taking over says it should be this way so the objects will run in the ASP process and it will prevent threading problems. While I contend that the objects should be compiled into a VB6 DLL and have the MTSTransactionMode propertly set to 'UsesTransactions' -- which will have the same effect Any input on the thought of having classes defined in ASP? Any articles you can point me ...

  1. #1

    Default Classes defined in ASP pages -- desirable?

    Is this ever desirable? I always thought it was a bad idea because the class isn't compiled, you can't use MTS/ COM+ etc. But the guy who developed the app I am taking over says it should be this way so the objects will run in the ASP process and it will prevent threading problems. While I contend that the objects should be compiled into a VB6 DLL and have the MTSTransactionMode propertly set to 'UsesTransactions' -- which will have the same effect

    Any input on the thought of having classes defined in ASP? Any articles you can point me to that would describe the pitfalls with this architecture


    Me Guest

  2. #2

    Default Re: Classes defined in ASP pages -- desirable?

    IMHO the only point in using classes in ASP is if you like the style.

    As you suggest, if you want to do some serious OO/COM work you create an
    ActiveX Dll.

    CJM

    "Me" <anonymousdiscussions.microsoft.com> wrote in message
    news:BE52F935-FB67-4E60-A7C6-3BF1360B7D4Amicrosoft.com...
    > Is this ever desirable? I always thought it was a bad idea because the
    class isn't compiled, you can't use MTS/ COM+ etc. But the guy who
    developed the app I am taking over says it should be this way so the objects
    will run in the ASP process and it will prevent threading problems. While I
    contend that the objects should be compiled into a VB6 DLL and have the
    MTSTransactionMode propertly set to 'UsesTransactions' -- which will have
    the same effect.
    >
    > Any input on the thought of having classes defined in ASP? Any articles
    you can point me to that would describe the pitfalls with this architecture?
    >
    >
    >

    CJM Guest

  3. #3

    Default Re: Classes defined in ASP pages -- desirable?

    It's a matter of style indeed. If you like the of your code looking
    OO, then classes are usefull in VBScript. You can always write a
    bunch of functions that do exactly the same as your class methods, but
    I like the fact that a class can hold "state" by setting a few
    properties, and then calling it's methods without having to pass a
    bunch of parameters along with every call.
    Too bad VBScript classes don't support inheritance, or you'd be really
    able to do some cool stuff.

    Switching code to an ActiveX DLL is something else though.
    If you don't have a considerable amount of code it's far easier to
    write a VBScript class instead, as this will be running in process
    with your ASP page which will be a lot faster when creating an
    instance than when an external process has to be initialised.

    The advantage of using a VBScript class anyway, is that if you want to
    change it into an ActiveX later on, you won't have to change a lot of
    your existing ASP code. Only the line where you create the object
    needs to be changed (if you don't change the interfaces of course)


    "CJM" <cjmworkyahoo.co.uk> wrote in message news:<e2CcU#oLEHA.808tk2msftngp13.phx.gbl>...
    > IMHO the only point in using classes in ASP is if you like the style.
    >
    > As you suggest, if you want to do some serious OO/COM work you create an
    > ActiveX Dll.
    >
    > CJM
    >
    > "Me" <anonymousdiscussions.microsoft.com> wrote in message
    > news:BE52F935-FB67-4E60-A7C6-3BF1360B7D4Amicrosoft.com...
    > > Is this ever desirable? I always thought it was a bad idea because the
    > class isn't compiled, you can't use MTS/ COM+ etc. But the guy who
    > developed the app I am taking over says it should be this way so the objects
    > will run in the ASP process and it will prevent threading problems. While I
    > contend that the objects should be compiled into a VB6 DLL and have the
    > MTSTransactionMode propertly set to 'UsesTransactions' -- which will have
    > the same effect.
    > >
    > > Any input on the thought of having classes defined in ASP? Any articles
    > you can point me to that would describe the pitfalls with this architecture?
    > >
    > >
    > >
    J. Baute Guest

  4. #4

    Default Re: Classes defined in ASP pages -- desirable?

    I like them because you get Intellisense but only if the class definition is in the same page which
    sort of limits the usefulness when you start to move them into includes.

    As an aside, you can extend the VBScript class concept to use WSCs (Windows Script Components) which
    can be stored as session variables as opposed to normal VBScript classes that can't. They act like
    COM components thus allowing intellisense but can be a pain to administer since you normally have to
    register them at least once on the webserver to get the ProgID registered.

    Chris.

    "J. Baute" <QQNVICFBGPKGspammotel.com> wrote in message
    news:1c1676e6.0404300611.117cdd30posting.google.c om...
    It's a matter of style indeed. If you like the of your code looking
    OO, then classes are usefull in VBScript. You can always write a
    bunch of functions that do exactly the same as your class methods, but
    I like the fact that a class can hold "state" by setting a few
    properties, and then calling it's methods without having to pass a
    bunch of parameters along with every call.
    Too bad VBScript classes don't support inheritance, or you'd be really
    able to do some cool stuff.

    Switching code to an ActiveX DLL is something else though.
    If you don't have a considerable amount of code it's far easier to
    write a VBScript class instead, as this will be running in process
    with your ASP page which will be a lot faster when creating an
    instance than when an external process has to be initialised.

    The advantage of using a VBScript class anyway, is that if you want to
    change it into an ActiveX later on, you won't have to change a lot of
    your existing ASP code. Only the line where you create the object
    needs to be changed (if you don't change the interfaces of course)


    "CJM" <cjmworkyahoo.co.uk> wrote in message news:<e2CcU#oLEHA.808tk2msftngp13.phx.gbl>...
    > IMHO the only point in using classes in ASP is if you like the style.
    >
    > As you suggest, if you want to do some serious OO/COM work you create an
    > ActiveX Dll.
    >
    > CJM
    >
    > "Me" <anonymousdiscussions.microsoft.com> wrote in message
    > news:BE52F935-FB67-4E60-A7C6-3BF1360B7D4Amicrosoft.com...
    > > Is this ever desirable? I always thought it was a bad idea because the
    > class isn't compiled, you can't use MTS/ COM+ etc. But the guy who
    > developed the app I am taking over says it should be this way so the objects
    > will run in the ASP process and it will prevent threading problems. While I
    > contend that the objects should be compiled into a VB6 DLL and have the
    > MTSTransactionMode propertly set to 'UsesTransactions' -- which will have
    > the same effect.
    > >
    > > Any input on the thought of having classes defined in ASP? Any articles
    > you can point me to that would describe the pitfalls with this architecture?
    > >
    > >
    > >

    Chris Barber Guest

  5. #5

    Default Re: Classes defined in ASP pages -- desirable?

    "Chris Barber" <chrisblue-canoe.co.uk.NOSPAM> wrote in message news:<#q02VFsLEHA.1392TK2MSFTNGP09.phx.gbl>...
    > I like them because you get Intellisense but only if the class definition is in the same page which
    > sort of limits the usefulness when you start to move them into includes.
    >
    > As an aside, you can extend the VBScript class concept to use WSCs (Windows Script Components) which
    > can be stored as session variables as opposed to normal VBScript classes that can't. They act like
    > COM components thus allowing intellisense but can be a pain to administer since you normally have to
    > register them at least once on the webserver to get the ProgID registered.
    yep, having yout classes recognised by Intellisense would be nice. I
    thought about faking it once by creating dummy classes in VB or as you
    mentioned WSC classes, using the same interfaces or something.

    Any idea how those WSC classes scale btw? What threading model do
    those have once you store them in the Session/Application collection?
    J. Baute Guest

Similar Threads

  1. Replies: 2
    Last Post: December 3rd, 12:47 AM
  2. How to test a hash of arrays for defined/not defined
    By Sisyphus in forum PERL Miscellaneous
    Replies: 1
    Last Post: June 30th, 01:11 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139