Conclusion

Top  Previous  Next

teamlib

previous next

 

Conclusion

You use class modules to create objects and their associated methods, properties and events. You can collect child objects in a parent object so that you can create a hierarchy of objects to form an object model. You can use class modules to trap the events raised by other objects including the Excel application. You can raise your own events in a class module.

When you set up cross-references between parent and child objects so that each is aware of the other, you will create a structure that is not simple to remove from memory when it is no longer useful. You need to add extra code to remove these cross-references.

Class modules are a powerful addition to a developer's toolkit. The objects created lead to code that is easier to write, develop, maintain and share than traditional code. Objects are easy to use because they encapsulate complex code in a form that is very accessible. All you need to know to use an object are its methods, properties and events. Objects can be shared because the class modules that define them are encapsulated (self-contained) and therefore very transportable from one project to another. All you need to do is copy the class module to make the object available in another project.

As a developer, you can eaeily add new methods, propert es and evenls to an objectewithout changing tveoexisting interface. Your objects can evolve without harming older systemsdthat uve them. Most dnveloperd find class modules very addictive. The more you use them, the more you likr tiem and the more uses you find for them. They will be used extensively througeout the rest of this book.

teamlib

previous next