Questions tagged [concrete-inheritance]

23 questions
57
votes
5 answers

Should I avoid multi-table (concrete) inheritance in Django by any means?

Many experienced developers recommend against using Django multi-table inheritance because of its poor performance: Django gotcha: concrete inheritance by Jacob Kaplan-Moss, a core contributor of Django. In nearly every case, abstract inheritance…
26
votes
1 answer

Different inheritance types in the same schema

I'm using Doctrine 1.2 on a symfony project, and I'm considering mixing concrete and column aggregation inheritance types in my schema: column aggregation lets me query in a parent table and get both parent and child records, while concrete…
15
votes
5 answers

Concrete method in abstract class

I understand an abstract class may contain abstract and concrete methods (i.e with body implementation). My question are: can subclasses inherit/override concrete methods from an abstract superclass. And secondly do they have to implement concrete…
user2240664
  • 183
  • 1
  • 1
  • 7
6
votes
1 answer

SQLAlchemy Polymorphic Relationship with Concrete Inheritance

I am using the concrete table inheritance with SQLAlchemy. In declartive style model class, I have configured it successfully. My code just like: class Entry(AbstractConcreteBase, db.Model): """Base Class of Entry.""" id =…
Jiangge Zhang
  • 4,298
  • 4
  • 25
  • 33
4
votes
1 answer

Doctrine 2 Concrete Table Inheritance with Associations

I have read Doctrine 2 Inheritance Mapping with Association but say if you needed Animal to be an entity in its own right, say for creating option lists. In this case the Discriminator Column for a Pet is in the species column in the animal…
gawpertron
  • 1,867
  • 3
  • 21
  • 37
4
votes
1 answer

SQL Concrete Vs Class Table Inheritance query speed on one subtype

I am weighing up between Concrete and Class Table Inheritance (see example below). Class Table certainly has a lot of benefits, in particular for my scenario, super table columns are guaranteed consistent across the full data set. However I have…
4
votes
1 answer

Peewee and Database Inheritance

I'm trying to learn Peewee and Bottle by making a book note-taking application. Say I have the following entities: Subject Book Chapter Note Tag I would like to be able to make Notes for Chapters, Books, and Subjects. In a DB, you would do: create…
Matthew Moisen
  • 16,701
  • 27
  • 128
  • 231
3
votes
3 answers

Symfony2, Propel fixtures and concrete inheritance

I got an issue with Propel fixtures loading in Symfony2. I have the following schema:
Jonathan Petitcolas
  • 4,254
  • 4
  • 31
  • 42
2
votes
2 answers

Hibernate MappingException with inheritance of a concrete non-domain class in Grails

The Scenario I have a need to represent an object in two different contexts. One context should not persist and the other should. The persistent objects are actual data pulled from another system. The non-persistent objects represent parts of a…
2
votes
3 answers

Should I use Abstract or Interface ... or start with Concrete class that should be extended?

I dont have enough of a grip on OO design to determine whether I am designing application well or not. Here is a simple Idea: I want to code a application for travelling on Metro. I started of definining the following: Trainline Interface which…
drlobo
  • 2,139
  • 5
  • 32
  • 42
1
vote
0 answers

Doctrine Inheritance: find all children of a table

I have a question about Table Inheritance in Doctrine. for an example I'll use 3 tables: Notification: columns: id is_viewed NotificationLike: columns: like_id inheritance: { type: concrete, extends: Notification…
tamir
  • 3,207
  • 2
  • 33
  • 51
1
vote
3 answers

How to create concrete class from a template class

Say I have a template class: template class StringDeque: public std::deque { public: ... private: typedef std::deque BaseClass; }; Say I want to create concrete class ArrayString where T=std::string. What is the…
idanshmu
  • 5,061
  • 6
  • 46
  • 92
0
votes
0 answers

In Python, how can I use a concrete method of an abstract class in the inherited class?

So I have an abstract class which has one non-abstract (concrete) method: class abstract_class(ABC): def __init__(self) -> None: self.a = 0 self.b = 0 def new_method(self): self.a = 1 self.b = 1 Now, I have…
0
votes
1 answer

How to express concrete method in abstract class on UML2 Class Diagram?

Problem mentioned in the underlined sentence in this image: I have been asked to add concrete public method in a abstract class in UML2. I am struggling to find the solution as I didn't find any material related this. I know that abstract class can…
0
votes
1 answer

How to implement hidden abstract method?

If the abstract method was hidden by previous abstract inheritance, how can I implement it in concrete class? I have no way to access it, only the access to the inheriting abstract method with same name. The system reports error even it's masked.…
oversea
  • 1
  • 1
1
2