|
-
Dec 19th, 2003, 02:50 PM
#22
I have never used inheritance in VB6 (naturally ), but I have used it in C++. I have been working on a modeling system that makes extensive use of run-time polymorphism, and inheritance is fairly fundamental in that. I have an array of pointers to the base class, and it really doesn't matter how many different types of classes I have inheriting from that base class, the system will work. This is a kind of built-in extensibility, since I can't decide how many trophic levels will be there (lake ecosystem modeling).
I was reading an editorial in a C++ prog journal a few months back, where the editor was complaining about tutorials all using trivial examples (an orange is a fruit) to show relationships between classes. He was saying that these were unrealistic examples, because nobody ever really uses inheritance in such simplistic fashion. I was tempted to write him to point out that I was doing just that. Each species inherits from the base class organism. Not only is this correct, but it is the most efficient way to go about it.
I may or may not use inheritance much as I move into .NET, but I will keep it in mind. It isn't useless, but you do have to guard against overdoing it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|