473,406 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Inheritance n level deep

Hi

is there some guide lines on how many level deep once can structure
the inheritance, I have 3 level deep inheritance setup and just
wondering whether this is the norm?
each level is generated by the presence of commonality in concept
between the classes.

thanks
Nov 11 '06 #1
1 1589

Gary Wessle wrote:
is there some guide lines on how many level deep once can structure
the inheritance, I have 3 level deep inheritance setup and just
wondering whether this is the norm?
each level is generated by the presence of commonality in concept
between the classes.
You've no doubt noticed that the language provides no limit, but that
isn't really the question.

The level at which a hierarchy is _too_ deep is when you cannot
comprehend it. Like function size, hierarchy depth is more about our
(as programmers/developers) inability to comprehend large structures
than about the compiler's abilit - and I think that depth isn't that
much more important than width.

You need the part of the hiararchy that you're working on to be clear
in your mind, but often you will find that the root of a hierarchy may
be sufficiently abstract that it can be ignored for many purposes - the
hierarchy has clear stratification that helps to keep it manageable.

Clear naming, good documentation and UML diagrams can also help us to
understand larger hierarchies.

The simplest rule is that if you find yourself getting confused it's
already too big. As you get better at designing them your abstractions
and layering will get better and you'll find that you can build and use
larger hierarchies without a huge increase in complexity.
K

Nov 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Graham Banks | last post by:
Does using multiple inheritance introduce any more performance overhead than single inheritance?
22
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
3
by: enchantingdb | last post by:
I have an exam tomorrow that covers the perceived advantages and disadvantages of object oriented programming, in particular polymorphism, inheritance and encapsulation. I know the advantages but...
0
by: Terry Hancock | last post by:
I've been discussing PyProtocols with a a friend collaborating with me on a SF game project, about the benefits and design concept of "component architecture", and I'm a little confused by what...
47
by: Mark | last post by:
why doesn't .NET support multiple inheritance? I think it's so silly! Cheers, Mark
25
by: Lars | last post by:
Hi, I have a base class holding a generic list that needs to be accessed by both the base class and its subclasses. What is the best solution to this? I am fairly new to generics, but I am...
14
by: karthikbalaguru | last post by:
Hi, What could be the maximum Accepted Layers/Levels of inheritance in a normal C++ program that has private(data),protected(data) and public(data,member functions) ? On what does this depend...
8
by: puzzlecracker | last post by:
The statement is taken from FAQ . What about non-virtual functions? Can they be overriden? I still don't see a good justification to prefer private inheritance over composition. In fact, I have...
3
by: johanatan | last post by:
When I first heard about these new features, I was very excited as it would have (if implemented as I had expected) rendered mimicking multiple inheritance almost painless in C#. Unfortunately,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.