Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

You have a class hierarchy:

D extends C which extends B which extends A, for example.

A would be the top class, but how about D? I am looking for a short and concise way of describing the position of D within the hierarchy

Is it the most specific class? the deepest class in the hierarchy? the last subclass? final class?

The class might or might not be final (java) or sealed (c#). what matters is that it is the last one of the hierarchy at a particular moment. If a newer class (E) appears that extends D then the proposed term would apply to it. Also, there might be more than one class that fit this description (both D and E extends C), the term should apply to both classes.

share|improve this question
6  
Unless D is sealed/final, I perhaps wouldn't give it a specific name since it might not be the end of the hierarchy. –  Telastyn Jun 13 '12 at 13:47
1  
Depending on the depth of the hierarchy, it could quite possibly be called a code smell or bug. ;) –  Max Jun 13 '12 at 13:50
    
@Max. I am aware of that. the depth is actually quite big, so yes. it is smell. Still, I need the term for a document I am writing –  santiagozky Jun 13 '12 at 13:57
    
I added a few more details about the final/sealed thing –  santiagozky Jun 13 '12 at 14:15

4 Answers 4

up vote 3 down vote accepted

How about the "last descendant" - if you're documenting something, just set out your terminology at the beginning or in a glossary.

share|improve this answer
    
I like this one. the answer from Jason is nice, but I think last descendant is more explicit –  santiagozky Jun 13 '12 at 15:33

I would use "most derived class", but that's probably because I spend entirely too much time reading the C++ standard, and that's the term it uses.

I doubt there's one term that applies equally well across languages and uses though. In C++, the accepted terms are "derived class" and "base class", so "most derived class" makes sense.

In Smalltalk, by contrast, the accepted terms are "superclass" and "subclass", so trying to use "most derived class" would seem odd, foreign, and quite possibly at least mildly confusing (but no, I don't recall Smalltalk documentation having a specific term that corresponds to "most derived class").

share|improve this answer

the deepest class in the hierarchy

Does it mean , this class can't be extended any further? If yes, We call that as final class java.

share|improve this answer
1  
I need the term for the class that is the deepest at a particular moment. if D is extended by E, then how will I call E? –  santiagozky Jun 13 '12 at 14:09

How about leaf class? http://en.wikipedia.org/wiki/Leaf_class

If you think of a base class as a "root" class, then the derived classes in the middle as branches, then calling these end/final classes "leaf" classes would make sense, no?

share|improve this answer
    
+1 this seems like a good candidate, although 'leaf' is more commonly used to refer to 'leaf nodes' in a tree structure. I'm not sure how universal the idea of a 'leaf class' is. –  MattDavey Jun 13 '12 at 14:04
    
@MattDavey, Yeah, I wish there was a more common term for a class that just so happens not to be extended but is not using a language feature like final or sealed –  Jason Holland Jun 13 '12 at 14:18
4  
In the absence of multiple inheritance, a leaf class is a leaf node in a tree structure. –  Jörg W Mittag Jun 13 '12 at 17:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.