Professional Web Applications Themes

COM Newbie Help - ASP Components

Posted this on microsoft.public.vb.com but its probably more appropriate in here. Hi and thanks in advance! I want to move existing VBS code from asp web pages into an activex dll to aid code reuse. The existing functions can be grouped into three broad groups. Content - functions present on all pages (or most of them) that generate dynamic html code. Email - creation of emails (web mail forms, subscription emails etc). Database - interogation of mySQL db resulting in an array to be used by content and email functions. Misc - miscellaneous functions such as string formatting. Do I; ...

  1. #1

    Default COM Newbie Help

    Posted this on microsoft.public.vb.com but its probably more appropriate in
    here.

    Hi and thanks in advance!

    I want to move existing VBS code from asp web pages into an activex dll to
    aid code reuse. The existing functions can be grouped into three broad
    groups.

    Content - functions present on all pages (or most of them) that generate
    dynamic html code.
    Email - creation of emails (web mail forms, subscription emails etc).
    Database - interogation of mySQL db resulting in an array to be used by
    content and email functions.
    Misc - miscellaneous functions such as string formatting.

    Do I;

    a) stick everything in one dll with one class module and the functions set
    as public and private according to use.
    i.e. customdll.allfuncs

    b) stick everything in one dll with multiple modules.
    i.e customdll.contentfuncs, customdll.emailfuncs etc

    c) split up the functions by category as above and put them in separate
    dlls.
    i.e. contentdll.funcs, emaildll.funcs

    If c, I assume that you would call the functions in a similar way to that
    used in ASP

    i.e.
    Set objemail = CreateObject("emaildll.funcs")
    emailsent = objemail.sendemail(to, from, subject, body) 'returns boolean
    true if email successfully sent
    <email failure code>
    Set objemail = Nothing

    Pretty much all the tutorials I've seent to date cover creating a single
    dll, but if I were to put everything in one dll in the default class module,
    I can foresee it becoming more of a pain to edit.

    Hope someone can clear this up for me.

    Many thanks,

    Damien




    Damien Phillips Guest

  2. #2

    Default COM Newbie Help

    If you are not too keen on using vb COM, have you looked
    into puting your functions into include files? That
    would do the same thing as the COM. My personal
    preference is to put all your code into 1 COM object so
    that you have 1 source to maintain. The only bad thing
    is that if you need to make the changes, obviously this
    will affect all of your functions and you will need where
    as if you have multiple, you don't have to worry about
    your changes "breaking" anything.
    >-----Original Message-----
    >Posted this on microsoft.public.vb.com but its probably
    more appropriate in
    >here.
    >
    >Hi and thanks in advance!
    >
    >I want to move existing VBS code from asp web pages into
    an activex dll to
    >aid code reuse. The existing functions can be grouped
    into three broad
    >groups.
    >
    >Content - functions present on all pages (or most of
    them) that generate
    >dynamic html code.
    >Email - creation of emails (web mail forms, subscription
    emails etc).
    >Database - interogation of mySQL db resulting in an
    array to be used by
    >content and email functions.
    >Misc - miscellaneous functions such as string formatting.
    >
    >Do I;
    >
    >a) stick everything in one dll with one class module and
    the functions set
    >as public and private according to use.
    >i.e. customdll.allfuncs
    >
    >b) stick everything in one dll with multiple modules.
    >i.e customdll.contentfuncs, customdll.emailfuncs etc
    >
    >c) split up the functions by category as above and put
    them in separate
    >dlls.
    >i.e. contentdll.funcs, emaildll.funcs
    >
    >If c, I assume that you would call the functions in a
    similar way to that
    >used in ASP
    >
    >i.e.
    >Set objemail = CreateObject("emaildll.funcs")
    >emailsent = objemail.sendemail(to, from, subject,
    body) 'returns boolean
    >true if email successfully sent
    ><email failure code>
    >Set objemail = Nothing
    >
    >Pretty much all the tutorials I've seent to date cover
    creating a single
    >dll, but if I were to put everything in one dll in the
    default class module,
    >I can foresee it becoming more of a pain to edit.
    >
    >Hope someone can clear this up for me.
    >
    >Many thanks,
    >
    >Damien
    >
    >
    >
    >
    >.
    >
    CST Guest

  3. #3

    Default Re: COM Newbie Help

    As long as the functionality can be explicitly separated as per your
    groupings then use separate objects. These will all be quicker to load and
    easier to use with a smaller footprint of methods and properties.
    You should definitely group functions that will not change significantly
    over time into a small library object so that it becomes a sort of 'de
    facto' standard reference from within standard ASP and your other DLL's -
    sort of like a hierarchy of top level and low level functionality.
    For efficiency you should consider using MTS to host them but this does
    impose the requirement that the function calls should *all* be stateless
    (they don't have to be but you won't see any saleability benefits unless
    they are [stateless]).
    In a real world scenario then there is no benefit whatsoever to using a
    single class containing all the functionality and it would be horrible to
    maintain, separate out logical 'objects' and usage into separate classes
    irrespective of the number of DLL's.
    If the amount of code is sufficiently small then you probably could just use
    one DLL but you'd still split into separate classes.

    Of course in terms of binary compatibility then you would see a maintenance
    benefit from a single DLL since you would have no reason to have to think
    about the compatibility - you could recompile to your hearts content and not
    break anything.

    Since you asked the question about using single / multiple classes at all
    then I have to assume that your level of experience with VB is not
    particularly extensive so I'd suggest you get a book about VB and ActiveX /
    COM and read it from cover to cover about 4-5 times! It will help enormously
    in the decisions that you want to make.

    I really liked "Dan Appleman's Developing ActiveX Components with Visual
    Basic":
    [url]http://www.amazon.co.uk/exec/obidos/ASIN/1562765760/qid=1068862226/sr=1-3/ref=sr_1_2_3/202-8457373-3890220[/url]

    Hope this helps.

    Chris.

    "Damien Phillips" <nospamspamless.com> wrote in message
    news:OnOgkygqDHA.2312TK2MSFTNGP12.phx.gbl...
    Posted this on microsoft.public.vb.com but its probably more appropriate in
    here.

    Hi and thanks in advance!

    I want to move existing VBS code from asp web pages into an activex dll to
    aid code reuse. The existing functions can be grouped into three broad
    groups.

    Content - functions present on all pages (or most of them) that generate
    dynamic html code.
    Email - creation of emails (web mail forms, subscription emails etc).
    Database - interogation of mySQL db resulting in an array to be used by
    content and email functions.
    Misc - miscellaneous functions such as string formatting.

    Do I;

    a) stick everything in one dll with one class module and the functions set
    as public and private according to use.
    i.e. customdll.allfuncs

    b) stick everything in one dll with multiple modules.
    i.e customdll.contentfuncs, customdll.emailfuncs etc

    c) split up the functions by category as above and put them in separate
    dlls.
    i.e. contentdll.funcs, emaildll.funcs

    If c, I assume that you would call the functions in a similar way to that
    used in ASP

    i.e.
    Set objemail = CreateObject("emaildll.funcs")
    emailsent = objemail.sendemail(to, from, subject, body) 'returns boolean
    true if email successfully sent
    <email failure code>
    Set objemail = Nothing

    Pretty much all the tutorials I've seent to date cover creating a single
    dll, but if I were to put everything in one dll in the default class module,
    I can foresee it becoming more of a pain to edit.

    Hope someone can clear this up for me.

    Many thanks,

    Damien





    Chris Barber Guest

Similar Threads

  1. A newbie with a newbie question
    By dusty_davis@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 5
    Last Post: October 14th, 07:54 AM
  2. Newbie FMS help please!
    By G1FEF in forum Macromedia Flash Flashcom
    Replies: 0
    Last Post: February 26th, 10:17 PM
  3. Newbie Needs Help!
    By starfishbaby in forum Macromedia Flash Player
    Replies: 1
    Last Post: September 14th, 06:40 PM
  4. newbie ill q
    By Curt Laven in forum Adobe Illustrator Windows
    Replies: 0
    Last Post: July 14th, 01:40 AM
  5. Please help the Newbie
    By Stingray in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 0
    Last Post: July 18th, 06:50 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