On Wed, January 21, 2009 10:09 am, Matt Slay wrote:
> In VFP, how can I have a structure of my classes wherein I have one class
>  ground-zero from which all other classes, even of different baseclass
> type, will inherit from?

You can't, well, not exactly.  VFP uses single inheritance, not multiple
inheritance like Dotnet.  What you can do is have a common object (e.g., a
custom object called oBase) that gets instantiated in each of your
classes' Init event, and then calls code in that common object.  For
example, each of your classes Init event could have this in them:

local loCommon as Object
loCommon = newobject("MyCommonObject",".\classes\MyCustomClasses.vcx")
this.oCommon = loCommon

this.oCommon.DoSomeCommonCodeForThisObject()


>
> For instance, say I want a method or property to be present in all my
> classes; every textboxes, every checkbox, every label, containers, etc.

Using what I've outlined above, you could.

>
> Since each class can only be based on a class of the same type, I have no
>  real ground-zero point at which I can add stuff that will be inherited
> by all my classes. So, apparently, I have to add the property or method to
> each of my root base classes. Add the new property to my textbox
> baseclass, add the new property to my checkbox baseclass, add the new
> property to my label base class, blah, blah, blah. Maintaining them in
> this manner seems to be a little short of a full OO architecture.
>
>
>
>> From what little I have learned about C# classes, I think you can
>> indeed
> have a one ground-zero object class on which even different class types
> can be based.


I'm not a DotNetter yet, but from what I've read, you absolutely can get
multiple inheritance in C# (and VB.Net and probably other DotNet langs).

hth,
--Michael



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to