Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Classes in vbscript in ASP page - more efficient?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi
I have asked this question in various MS newsgroups and I never seem to get an answer. Seems to me to be a really simple question ! If I have an ASP page and I create a class in VBscript in the page, with functions etc. is this more efficient than having spagehetti code when the page is parsed and compiled or the same? Or put it another way, can I improve the performance of ASP pages by writing classes to encapsulate functions etc. or is it purely a layout and visual readability gain that it would give me?

I hoep someone out there can answer this query!
 
Using data abstraction, especially in a scripting language (as opposed to a full-fledged programming language) is not going to give you much more (if any at all) in the way of performance gains -- what it's going to do is make your coding life a helluva lot easier.

Not only is abstraction excellent programming practice, but through the use of pre-defined data structures and class functions and procedures that are developed, tested, and trusted, you will cut your development time by leaps and bounds -- the only code to debug will be the new stuff that you might add in to enhance what are already 'trusted components'

If you really want to improve the performance by using abstraction, look into writing ActiveX dll's and registering them on your server... that's where you'll get the performance boost because the code in there is pre-compiled and you just call on the objects as you need them -- you'll realize a performance boost that parallels the boost you would get from executing database commands via stored procedure rather than SQL statements --

Just think if every time you wanted to use an ADO object (i.e. connection, recordset...) the code that is behind all that wonderful stuff had to be compiled -- it would take forever, and that's why they are in dll's -- you just call on that predefined (and pre-compiled) object whenever you need it.

I hope this clears it up a bit for you. :)
Paul Prewett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top