On Sep 3, 2006, at 3:57 AM, Carlos M wrote:

Sorry for the ignorance, but what is a Virtual Class and what is useful for? I searched the net and what I found I didn't understand it (wikipedia.org does not have anything about it either). Does it have anything to do with the Singleton Pattern?

An official Virtual class is one that cannot be created in your application without first subclassing it. It is a class which is usually mostly complete (like 90%), and so is not fully functional.

One purpose I am using it for is to simplify the subclasses so that they do not have quite as much code.

I have the XBarBase class which is my virtual class. Then I have XBarButton as a subclass of XBarBase, and I have a second class called XBarSpacer which is also a subclass of XBarBase. Any XBarButton and XBarSpacer is also a XBarBase, but since XBarBase only has limited drawing features it is not a useful class by itself.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to