Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
If inheritance is a prime reason for OOP, then why...
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00171748
Message ID:
00172004
Views:
63
Hiya Rox,

First, thanks for the kind words.

I don't know if I'm going to provide you with anymore insight, but here's how I handle things. I don't know if it's good or bad OOP, but it works for me.

I tend to define objects in very precise terms (see signature). I personally believe that this is one of the unrealized keys to developing maintainable applications.

When the need arises for an object to exhibit behavior that already may be partially defined, it makes me stop and think about both the behavior in the existing object, and what's required.

In general, I will not override existing behaviors, but rather create a new object. I believe that in overriding what already exists, you fundamentally change that object. If, in this case, such a fundamental change is required, then it is evidence that a new object is needed.

I want to stress that this does not apply to adding functionality, but only to changing that which already exists. In short, polymorphism should be used only for extension of behavior, not modification of it.

This gets into what I spoke of earlier in the thread, where you get into the "square peg/round hole" situation.

Have a great New Year (and I hope you don't get too much paint splattered on you :-)).
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform