Microsoft Office Automation with Visual FoxPro

Wrapping it up

Creating your own wrapper classes may seem like an overwhelming task. Just remember that you don t have to do it all at once. The secret is to stay alert and, as soon as you find yourself thinking, "I ve written this code before," stop and take the time to wrap it up.

In an ideal world, of course, you would wrap every server method before you use it so that you wouldn t get caught short when the next version of the server application introduces a change. But we don t write code in an ideal world. Wrap the methods you use regularly, and put the most effort into the code you use most often. If you find that a method is becoming overly complicated or seems to need a lot of parameters, consider breaking it up into multiple methods.

Whatever you wrap, document it carefully. You re likely to remember how to use the methods you use every day, but you won t necessarily remember the names and parameters for methods you only use once a month.

Copyright 2000 by Tamar E. Granor and Della Martin All Rights Reserved

Категории