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
4
votes
6 answers

.NET Object Hierarchy - To Event or not to Event

Your job is to design a Project Plan class library which supports the tracking of tasks (similar to how MS Project works). This class library has a Task object (among others). The Task object has a EstimatedHours (Double), StartDate (DateTime), and…
Brandon Montgomery
  • 6,924
  • 3
  • 48
  • 71
4
votes
2 answers

How can I make C++ prefer to match a parent class overload instead of a template?

class Parent {}; class Child : public Parent {}; class Foo { public: Foo (Parent &) {}; template Foo (const T &); }; int main () { Child c; Foo foo (c); } This produces a linker error since the constructor for…
spraff
  • 32,570
  • 22
  • 121
  • 229
4
votes
3 answers

How to link "parallel" class hierarchy?

I've got a little class hierarchy where each class corresponds to a certain TComponent descendent (say base class TDefaultFrobber with descendents TActionFrobber and TMenuItemFrobber, corresponding to TComponent, TCustomAction and TMenuItem,…
Uli Gerhardt
  • 13,748
  • 1
  • 45
  • 83
4
votes
1 answer

Proper use of super in Python -- should I reference the class name explicitly?

class Foo(object): def whee(self): return 77 class Bar(Foo): def whee(self): return super(Bar, self).whee() + 1 class Baz(Foo): def whee(self): return super(self.__class__, self).whee() + 1 Both Bar and Baz…
Jason S
  • 184,598
  • 164
  • 608
  • 970
4
votes
4 answers

Object browser for PHP

I want to browse huge amounts of code written in PHP and it would be useful to have a graphical representation of various classes and their methods. Do you know of (free) tools making this possible?
akosch
  • 4,326
  • 7
  • 59
  • 80
4
votes
1 answer

Can anonymous modules and class be nested in Ruby?

I can define an anonymous class within an anonymous module: c = nil m = Module.new do c = Class.new end m #=> # c #=> # Is the above equivalent to: m = Module.new c = Class.new In other words:…
Stefan
  • 109,145
  • 14
  • 143
  • 218
4
votes
3 answers

Introducing interfaces into an existing class hierarchy in Delphi

Are there any side effects to changing a class hierarchy's ancestor from TObject to TInterfacedObject so that I can implement interfaces further down the inheritance chain? I've programmed in Delphi for several years but never encountered…
Kenneth Cochran
  • 11,954
  • 3
  • 52
  • 117
4
votes
2 answers

Understanding Java Interfaces Principles

I am reading a Java book and stuck again this time thinking about what this whole paragraph actually means: Interfaces are designed to support dynamic method resolution at run time. Normally, in order for a method to be called from one class to…
Salivan
  • 1,876
  • 7
  • 26
  • 45
4
votes
2 answers

c++ function overload resolution regarding templated type and class hierarchy

Possible Duplicate: Priority when choosing overloaded template functions in C++ A templated function gives me the convenience to operate on a variety of types: template void destroy(T* obj) { delete obj; } But at some point I…
Ricky Lung
  • 680
  • 7
  • 12
4
votes
1 answer

Python multiple inheritance: which __new__ to call?

I have a class Parent. I want to define a __new__ for Parent so it does some magic upon instantiation (for why, see footnote). I also want children classes to inherit from this and other classes to get Parent's features. The Parent's __new__ would…
Oliver Zheng
  • 7,831
  • 8
  • 53
  • 59
4
votes
5 answers

Unit testing of child classes

Say we have this hyper simple class hierchy: public class SomeMath { public int Add(int x, int y) { return x + y; } } public class MoreMath : SomeMath { public int Subtract(int x, int y) { return x - y; …
Svish
  • 152,914
  • 173
  • 462
  • 620
4
votes
1 answer

Qt class hierarchy image/pdf

Do you know of any decent image or pdf of the class hierarchy of Qt 4? Such as they have for Qt 3: ftp://ftp.trolltech.com/qt/pdf/3.0/qt30-class-chart.pdf
Ferenc Deak
  • 34,348
  • 17
  • 99
  • 167
4
votes
0 answers

Can Visual Studio export its "Class View" to plain text?

Can Visual Studio (2010 or 2012) export its "Class View" to plain text? I don't see any options or other way to do this except manually. Are there any other tools for creating a plain text class view / hierarchy / list from code or Visual Studio…
8bitcartridge
  • 1,629
  • 6
  • 25
  • 38
4
votes
3 answers

Retrieve only the superclass from a class hierarchy

I have an scenario as the following: @Entity @Table(name = "ANIMAL") @Inheritance(strategy = InheritanceType.JOINED) public class Animal implements Serializable { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator =…
Gustavo Fava
  • 63
  • 1
  • 4
4
votes
5 answers

Is there a way of finding what .NET classes implements a certain interface?

For example if I wanted to see what my .NET options were for something implementing IList or IDictionary. Is there a way to find that for example in the MSDN documentation?
Svish
  • 152,914
  • 173
  • 462
  • 620