Wrapping Functionality to Avoid Redundant Coding

Tired of rewriting or copying code you use over and over? Learn about wrapping functionality to avoid redundant coding.

Tim Huckaby

February 7, 2000

1 Min Read
ITPro Today logo in a gray background | ITPro Today

CreateDS.vbs depends on PMAdmin.vbs, so I wrapped the functionality of PMAdmin.vbs in CreateDS.vbs. If you're not a software developer, you might not have heard the term wrap before. The term comes from COM programming, in which all COM objects are technically available for reuse in other pieces of code. In other words, you don't have to reinvent the wheel each time you need the functionality. For example, I've written several ActiveX Data Objects (ADO) that companies use in the middle tier of their Web sites. I needed to search the Registry for a value in those objects and had previously written a separate COM object that pulls values from the Registry. It would be senseless to rewrite the Registry reader code by copying it into my ADO, so I simply referenced it in my ADO code. In other words, I wrapped the Registry reader object's functionality. In CreateDS.vbs, I use similar technology to wrap the functionality of PMAdmin.vbs.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like