Key data: Inheritance, STI or otherwise?

I can’t find any information in the documentation or through Google, but if there is anything, a pointer to it will be wonderful.

In my application, I have Thingas the main data class. I intend to be that Thingcontains a lot Item, which has a bunch of fields, such as order, and created_dateetc. However, there are many types Item, each of which has its own set of fields. Ideally, I would like to create several subclasses Itemso that I can access all the elements together in one array or something like that.

In Rails, I would use STI for this. Does Core Data support this behavior?

Thank!

+3
source share
1 answer

You can create an abstract entity of an element, and then remove each of your unique elements from it. Keep in touch so that your Thing can see all of them.

Be careful, however, that under the hood all these children will actually be placed on one wide table, so you will need to check performance considerations.

+5
source

Source: https://habr.com/ru/post/1734120/


All Articles