I
I
Ilya Myasin2017-08-11 15:57:19
SQL
Ilya Myasin, 2017-08-11 15:57:19

"Core Entities & Hiers" - a mysterious pattern for inheritance in the database, who will find the source?

On Habré in the comments, I accidentally stumbled upon this way of organizing the inheritance of entities at the level of a relational database:

in the case of restaurants and hotels, you can use the Core Entities & Hiers approach - 1 table - "geo-object" (name, address, type, ...) + 1 table for each type of entity: restaurants, hotels, cheburechnye, ...

I went to google, I came across a few more mentions on Habré and not only - but everything is in Runet. I took a closer look and saw that there was a typo in "hiers", it should be "heirs" ("heirs"). I was delighted, I googled "core entities & heirs" ... and figs - the only occurrence, and also in Russian.
The trick is quite simple: we take out the common fields in the "parent" table, for the heirs we create our own tables with their fields, join by primary - INNER to pick up the parents, LEFT - heirs, there can be several levels. I invented it many years ago on my own, later I repeatedly met descriptions of similar schemes. But I saw it in the form of a term for the first time, and therefore it is curious to find out where it came from and whether there is somewhere a canonical description of the pattern (how,
PS I call on habrausers Denis Beskov and potapuff who used this term =)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2017-08-11
@dubr

If I correctly understood the principle of operation, then we are talking about the Class Table Inheritance pattern described by Fowler

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question