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
1 answer

Serializing POCO Excluding Class Members

I wish to make a POCO [Serializable] but not any other class members in its class hierarchy tree. I know there is [NonSerialized] which works only for fields, but is there any way to exclude them or choose specific members using [Serializable] on…
user24985
  • 765
  • 8
  • 12
3
votes
1 answer

Traverse a class hierarchy from base to all descendants

In an iOS app I am writing I want to traverse a class hierarchy to make an inventory of all subclasses. My intent is to use each subclass type as a key -- via NSStringForClass() -- in a dictionary. My motivation is to be able to automatically…
dugla
  • 12,774
  • 26
  • 88
  • 136
3
votes
1 answer

Is there a utility for Delphi 6 that analyzes class hierarchies and can be queried for method ancestry?

Is there a tool for Delphi 6 that can analyze the class hierarchy of your application and answer questions about particular methods? I could use a tool that could take a particular method name and it would show which classes in the call hierarchy…
Robert Oschler
  • 14,153
  • 18
  • 94
  • 227
3
votes
1 answer

On instance hierarchies in Haskell

I have the following definitions: data Egg = ChickenEgg | ChocolateEgg deriving Show data Milk = Milk Int -- amount in litres deriving Show class Price a where price :: a -> Int instance Price Egg where price ChickenEgg = 20 price…
coderodde
  • 1,269
  • 4
  • 17
  • 34
3
votes
3 answers

lift-json serialization of case class hierarchy

I have a hierarchy like the following: case class A(val a: Long, val b: String) case class B(val c: String) extends A(a=3, b="a string") and I'm trying to serialize it using lift-json ala the following: val obj = B(c="another string") val…
outside2344
  • 2,075
  • 2
  • 29
  • 52
3
votes
4 answers

Objective-C inheritance; downcasting/copying from parent class to derived class

In my program I have a class, say ClassA. I'd like to create a derived class, say ClassB. My program has functions returning instances of ClassA and in certain cases I'd like to use these returns to create an instance of ClassB. Doing the naive…
3
votes
1 answer

java inheritance and design patterns advises

I and doing an app in Android which can run different ML models and I want to create some classes to represent the data of the results, each ML model has it owns variables/result, for example, a classification problem has labels meanwhile other do…
JMP
  • 75
  • 7
3
votes
2 answers

Why value is not a member of class in ArrayBuffer[Any]

I've just started learning scala. In classes primary constructor parameters with val and var are public whereas parameters without val or var are private values. So, when I'm trying to execute following code, everything should work fine. import…
Vedanshu
  • 2,230
  • 23
  • 33
3
votes
4 answers

Objective-C organization of hierarchies of class clusters

This is a question of class design with Objective-C. Here is an example: File systems have files and directories. Both are "nodes". Walking a directory for example yields a list of nodes, some being [sub]directories, other being files. This points…
Jean-Denis Muys
  • 6,772
  • 7
  • 45
  • 71
3
votes
1 answer

ficus configuration load generic

Loading a ficus configuration like loadConfiguration[T <: Product](): T = { import net.ceedubs.ficus.readers.ArbitraryTypeReader._ import net.ceedubs.ficus.Ficus._ val config: Config = ConfigFactory.load() config.as[T] fails with: Cannot generate a…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
3
votes
1 answer

Using subclass implementation in the definition of superclass functions

In my Haskell program I have some typeclasses representing abstract notions of "shapes", namely -- | Class representing shapes. class Shape a where isColliding :: (Shape b) => a -> b -> Bool centroid :: Point -- | Class representing shapes…
3
votes
4 answers

Ruby: How do we identify whether an object o has a class C as its ancestor in the class hierarchy?

In Ruby, is it possible to identify whether an object o has a class C as its ancestor in the class hierarchy using any method? I've given an example below where I use a hypothetical method has_super_class? to accomplish it. How should I do this in…
arrac
  • 597
  • 1
  • 5
  • 15
3
votes
2 answers

Common Lisp class hierarchy

Greg Pfeil's Class Hierarchy diagram provides a comprehensive picture the Common Lisp type system. But I'm trying to better understand the class relationships at the top of the hierarchy. For a simple example, let (defstruct person name age), and…
davypough
  • 1,847
  • 11
  • 21
3
votes
1 answer

How can I improve the hierarchy of my event classes?

For the XMPP interface for the Stack Overflow chat I am parsing the JSON feed from chat and generating Ruby objects for every chat events, such as messages sent, edits sent, users logging in or out, etc. I also generate events for "slash-commands"…
Josh
  • 10,961
  • 11
  • 65
  • 108
3
votes
2 answers

Table design and class hierarchies

Hopefully someone can shed some light on this issue through either an example, or perhaps some suggested reading. I'm wondering what is the best design approach for modeling tables after their class hierarchy equivalencies. This can best be…
Dan Lugg
  • 20,192
  • 19
  • 110
  • 174