|
[About] [Theory] [Download] [History] [Future plans] |
|
Initial Release
This is the first public release of the utility, although it was submitted to
Planet Source Code and so far has met with universal approval. The source
code is available here as well. It's a good example of how to build your
own Add-Ins for the Visual Basic 6 IDE.
The VB6 Child Class Builder Utility is a Visual Basic 6 Add-In for creating descendent classes through interface inheritance. Ok, those of you who haven't just run screaming from the page should check out the screenshot of the utility about to sub-class my "Preferences" class..
It looks like the standard VB Class Builder Utility, doesn't it? That's more for familiarity and my own tinkering than anything else. You select a base class from the list on the left, and the listview on the right will show you the public members you will have to implement. You can't edit them, they just sit there and look pretty, but they will give you a good overview of what you are getting yourself into.
(Not for the faint of heart, you've been warned)
In a true Object Oriented programming language, you can create objects which are descendants of other objects through the concept of inheritance. Visual Basic 6 supports a limited subset of this behavior known as Interface Inheritance. Although it is quite limited in comparison to a true inheritance model, you can accomplish a surprisingly large amount of the same behaviors this way.
In interface inheritance, the base class typically contains no code, and is used simply as a template to define what the descendant classes must look like. Each descendant class is then obligated to implement all the methods and properties exposed on the base class before they can be compiled. There is nothing that says you CAN'T put code in the base class, though, and this can be used to the programmer's advantage.
If we treat the base class as BOTH a template, AND a base-class implementation, then we can not only force each child class to appear identical when viewed through their common interface, but we can also centralize common code into the base class, saving space and easing code maintenance. This also provides a level of flexibility not offered by a traditional inheritance model. The developer has the control to perform child-specific steps before or after calling the base class code, and by NOT calling the base class code at all, we can override it's behavior entirely.
It takes a bit more code to pull off an interface inheritance hierarchy than a true descendant relationship would, and that's where the utility comes into play. The Child Class Builder Utility will create a new class from an existing one. The new child class will not only implement the base class' interface, but delegate functionality as well. In addition, the newly created class will have it's OWN set of properties and methods with the same name as the base class'. This allows the new class to be defined in terms of the base class OR child class, and still have the same properties and methods available.
6/12/01 v1.0.0 - This is the first public release of the utility.
Currently, only Properties and Methods are propagated from the base class to the child class. Public member variables are also considered part of an interface definition, and should be included as well, although they are usually considered bad programming form, and are thus not as common.
Also, in a future version, I want to bring any method and property header comments along for the ride, allowing base-class comments to be copied as boilerplate text into the descendent classes. This should be fairly easy to do, but has been pushed to the back burner while I work on other projects.
There is only one installation package available. It does not contain any runtime libraries, or Windows common control components. The DLL itself is barely over 100kb, and I don't have the room here for a 10Mb installation package. If you have VB6, then you should have everything you need. If you have any trouble, let me know, and I'll see if I can help.
Note: Due to space restrictions, the files are not hosted on this website, but are in the files section of my YahooGroup. The group itself is for discussion of my personal projects. If you want to me informed of new versions, or new projects that I release, sign up and I'll let you know. It's pretty low-traffic so far, but if you ONLY want the official announcements from yours truly, you can always choose the "Only Special Announcements" message delivery option.
I have had reports of some users experiencing difficulty using these links. This seems to be a problem with YahooGroups. If you have any trouble, try going to the actual YahooGroup files section and selecting the files from there. That always seems to work.
|
![]() |
Last updated 10/09/01
|