Questions tagged [class-hierarchy]

Class hierarchy refers to a set of classes and their inter-relationships.

A classification of object types, denoting objects as the instantiations of classes (class is like a blueprint, the object is what is built from that blueprint) inter-relating the various classes by relationships such as "inherits", "extends", "is an abstraction of", "an interface definition".

http://en.wikipedia.org/wiki/Class_hierarchy

276 questions
9
votes
5 answers

Delphi 7 : how to generate class hierarchy?

I am seeking to understand someone else's code in Delphi 7 (I suspect that newer version have this built in, but I don't want to spring > $1k for the newest version). Are their any (preferably FOSS) tools which will help me generate a class…
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
9
votes
4 answers

What is the opposite of c++ `override` / `final` specifier?

In c++11 the override specifier protects from not overriding an intended virtual base function (because the signatures do not match). The final specifier protects from unintentionally overriding a function in a derived class. => Is there a…
Martin Hennings
  • 16,418
  • 9
  • 48
  • 68
9
votes
5 answers

How should a basic class hierarchy be constructed?

I know how to code and use simple classes, and I even know how inheritance works and how to use it. However, there's a very limited amount of guides on how to actually design the structure of your class hierarchy, or even how to design a simple…
Skamah One
  • 2,456
  • 6
  • 21
  • 31
9
votes
3 answers

Java - Designing a validator, class hierarchy

I'm working on designing a validator for certain objects (fields of those objects). These objects are enclosed in one, bigger object - container. Example: Car as a container . Consists of Wheels, Engine, Body. Lets say i need to validate if wheels…
Raidmaster
  • 603
  • 2
  • 7
  • 15
9
votes
3 answers

Application to generate Java class hierarchy diagram

Looking for a tool that: Produces a visually pleasing (not garish), orthogonally structured graph hierarchy Outputs high-quality PNG images (300dpi+) Visually differentiates classes, abstract classes, interfaces, and enumerated types (preferably by…
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
8
votes
1 answer

What's the meaning of "value class space is flat"?

I am now reading the book Programming in Scala. In chapter 11, it mentioned: Note that the value class space is flat. But no one explain what it means. Is it important? Why? And how to use and how to check value class space is really flat. It…
Wang Lihe
  • 95
  • 7
8
votes
4 answers

How big class hierarchy influence on java performance?

I have class that extends another class, that extend another class.. and so on. How slow (in percent) class with 100-level hierarchy level will work, then class with 10-level hierarchy level?
qwazer
  • 7,174
  • 7
  • 44
  • 69
8
votes
3 answers

Creating a singleton class with dispatch_once for class hierarchy

I have a 2 child classes that inherit from 'MyClass' and each child class should be a singleton. I've used this pattern for getting a static instance when I don't have any other classes inheriting: + (MyClass *)getInstance { static…
Howard Spear
  • 551
  • 1
  • 5
  • 14
7
votes
5 answers

Force all classes to implement / override a 'pure virtual' method in multi-level inheritance hierarchy

In C++ why the pure virtual method mandates its compulsory overriding only to its immediate children (for object creation), but not to the grand children and so on ? struct B { virtual void foo () = 0; }; struct D : B { virtual void foo () { ...…
iammilind
  • 68,093
  • 33
  • 169
  • 336
7
votes
2 answers

F# discriminated unions versus C# class hierarchies

I have the following code: public abstract class A ... public class B : A ... public class C : A ... void my_fct(A x) { if (x is B) { block_1 } else if (x is C) { block_2 } else { block_3 } } and I wonder if it is a good translation from…
Hugo
  • 535
  • 1
  • 3
  • 13
7
votes
1 answer

Constructing hierarchy from dictionary/JSON

I'm looking for a way to create hierarchy in form of child parent relationship between two or more instances of same class. How would one go about creating such objects from nested dictionary like in example ? Is this even possible ? Is there some…
7
votes
4 answers

NHibernate - Changing sub-types

How do you go about changing the subtype of a row in NHibernate? For example if I have a Customer entity and a subclass of TierOneCustomer, I have a case where I need to change a Customer to a TierOneCustomer but the TierOneCustomer should have the…
Andy Whitfield
  • 2,373
  • 2
  • 19
  • 22
7
votes
3 answers

How to select which class to display in class hierarchy in Eclipse?

I have turned on class hierarchy view for Java in eclipse and it is showing some arbitrary class, unrelated with my editor or something other apparently. Link with editor option is on and has no effect. How to fix? UPDATE Link with editor is in…
Dims
  • 47,675
  • 117
  • 331
  • 600
7
votes
2 answers

How do I change the hierarchy parent of an activity?

At the moment it is main activity but I want to change it to the Categories activity. Is this where the problem lies? @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: …
user2229066
  • 143
  • 3
  • 13
6
votes
1 answer

Passing the context around in a C# class library, looking for an "easy" way without using static

For a library (.NET Standard 2.0), I designed some classes that look roughly like this: public class MyContext { // wraps something important. // It can be a native resource, a connection to an external system, you name it. } public…
1
2
3
18 19