class-hierarchy

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 return an instance of a subclass of the child class's bases and the Parent class. This is ...

C# property not available in derived class

I'm not sure what's going on. I have the following base class: public class MyRow : IStringIndexable, System.Collections.IEnumerable, ICollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IDictionary<string, string> { ICollection<string> IDictionary<string, string>.Keys { } } And then I...

Select children kinds from app engine datastore - pros and cons.

I have models set up as the following: class Day(db.Model): date = db.DateProperty() total = db.FloatProperty() class Event(db.Model): desc = db.StringProperty() amount = db.FloatProperty() The hierarchy is as such: User > Day > Event (Users have Days. Days have Events.) When a user logs in I want to select their day...

How to implement or emulate an "abstract" OCUnit test class?

I have a number of Objective-C classes organized in an inheritance hierarchy. They all share a common parent which implements all the behaviors shared among the children. Each child class defines a few methods that make it work, and the parent class raises an exception for the methods designed to be implemented/overridden by its children...

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

A templated function gives me the convenience to operate on a variety of types: template<typename T> void destroy(T* obj) { delete obj; } But at some point I want to do some specialization on a class hierarchy: class Base { virtual void doSomething(); }; class Derived : public Base {}; void destroy(Base* obj) { obj->doSomethi...

How would I best address this object type heirachy? Some kind of enum heirarchy?

I'm curious as to any solutions out there for addressing object heirarchies in an ORM approach (in this instance, using Entity Framework 4). I'm working through some docs on EF4 and trying to apply it to a simple inventory tracking program. The possible types for inventory to fall into are as follows: INVENTORY ITEM TYPES: Hardware P...

Foolishness Check: PHP Class finds Class file but not Class in the file.

I'm at a loss here. I've defined an abstract superclass in one file and a subclass in another. I have required the super-classes file and the stack trace reports to find an include it. However, it then returns an error when it hits the 'extends' line: Fatal error: Class 'HTMLBuilder' not found in View/Markup/HTML/HTML4.01/HTML4_01Buil...

Advice on using (or not using) XML in a hierarchical object model

I'm developing a hierarchical object model that is self-referencing as a 0/1 --> * relationship. An object without a parentID is a root element. The parentID is also the foreign key on the self-join. From my understanding, using the parentID as a foreign key will only point to a column where child elements may be found --> does this forc...

How to test if one java class extends another at runtime?

How to I test if a is a subclass of b? Class<?> a = A.class; Class<?> b = B.class; ...

Simplifying complex class heirarchy

With the goal of maximizing code reuse, I have created a rather complex class hierarchy for my Python code. It goes something like this: class ElectionMethod class IterativeMethod class SNTV ... class NonIterativeMethod class OrderDependent class CambridgeSTV ... class Ord...

Is/Are there any standard package structuring/heirarchy practices for Android?

When developing J2EE web applications I would typically organise my package structure in the following way com.jameselsey.<applicationName>. Controller - Controllers/Actions go here Service - transactional service classes, called by Controllers Domain - My domain classes/objects that the application uses DAO - abstract DAO layer DAOIm...

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 interfaces. I became accustomed to using them in other languages. Now that I'm involved in a Delphi...