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.
February 7, 2000
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.
About the Author
You May Also Like