Master Data: Abstract Entities and Inheritance Relationships

My exact model is difficult to explain, so tell me that I am modeling fruits and their seeds in Xcode Core Data modeler. Here's some "data pseudo code":

abstractEntity Fruit
attribute sweetness
relationship Seed

abstractEntity Seed
attribute shape

concreteEntity Apple inherits Fruit
concreteEntity Orange inherits Fruit

concreteEntity AppleSeed inherits Seed
concreteEntity OrangeSeed inherits Seed

      

The reason I modeled this way is because I want to be able to get a mix of fruits and sort them according to their seed shapes. Given this model, here's my question:

Is there any direct way in the Xcode modeler (i.e. from the GUI) that would allow me to specify that Apples can only have AppleSeeds and Oranges can only have OrangeSeeds? In the above model, specific fruits inherit the abstract seed ratio that I need in order to harvest and sort the mixed fruits / seeds, but I don't see any way to ensure the exact seed ratio that each specific fruit should have.

I see many different ways to do this outside of the modeling GUI, but just want to make sure I haven't missed anything. Any suggestions?

Hope this example makes sense!

+2


source to share


1 answer


The only way I can think of is to remove the seed relationship from the entity and establish a specific AppleSeed and OrangeSeed relationship in the entity. You can override relationships in an entity without removing them from the entity, but as far as I know, there is no way in the model editor to do what you describe.



+3


source







All Articles