在CoreData模型中使用父实体 [英] Using Parent Entity in CoreData Models

查看:177
本文介绍了在CoreData模型中使用父实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天开始使用实体继承与核心数据,任何人都有这个功能的任何经验吗?我看到所有具有父实体的实体现在在打开sqlite文件时已经转换为一个大表。我担心性能和表锁。任何人都可以分享他们的经验吗?


b 您的架构可能会极大地影响性能,将列添加到表中的行不是您的性能问题。遍历复杂的关系和管理大型BLOB是你的性能问题。



是的,我使用实体继承。是的,它是快速。是的,它让我做一个健全的模型。也就是说,传统的OOP智慧这些天是限制你的继承层次的深度。这在使用Core Data时可能是个好主意。对象/实体的组成是您的朋友。



Andrew


I started using entity inheritance today with core data, does anyone have any experience with this feature?. I see that all of my entities that have a parent entity have now converted into one big table when opening the sqlite file. I'm worried about performance and table locks. Anyone please share their experience?

解决方案

the Reverend,

While your schema can dramatically affect your performance, added columns to rows in a table is not your performance problem. Traversing complex relations and managing large BLOBs is your performance problem.

Yes, I use the entity inheritance. Yes, it is fast. Yes, it has allowed me to make a sane model. That said, the conventional OOP wisdom these days is to limit the depth of your inheritance hierarchies. This is probably a good idea when using Core Data. Composition of objects/entities is your friend.

Andrew

这篇关于在CoreData模型中使用父实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆