Eva*_*ell 11 iphone core-data relational-database
这是一个关于Apple设计决策的哲学问题,而不是关于核心数据的问题.
Why in the world is it useful to have a model system that is so difficult to prepopulate? What are the advantages? I know you can have your program generate the sqlite file and edit it manually, but as far as I can tell, you can't do that if you have any relationships at all.
I compare this to the MVC paradigm used in rails, which seems to make way more sense. Models in rails provide a similar level of abstraction to Core Data (from what I can tell) but they also allow you to enter whatever you want into your database manually (or through a script).
The problem I have with Core Data is that: since rails seems to prove (to me) that you can have an excellent model abstraction from the database while retaining several convenient methods to prepopulate it, what possible advantages does removing that ability offer? Is Core Data somehow more efficient? Is the difficulty involved in prepopulation merely a side-effect of other design choices, and if so, why wasn't prepopulation taken into consideration?
(A disclaimer that I'm genuinely interested in the reasoning behind these choices, and though my post might suggest it, I'm not really looking for a "Models in Rails vs. Core Data" debate.)
Mar*_*rra 11
因为Core Data 不是数据库.它是一个碰巧持久存储到磁盘的对象图,其中一种持久性格式是数据库.这意味着您需要在反向PoV中查看它.
Core Data旨在尽可能快地从该持久性存储中检索对象并将其保存回来.这样做的一个副作用是持久性格式专注于使该目标更快并且与其他任何东西兼容是最好的次要.因此,SQLite文件的内部结构旨在提高性能,而不是兼容性.
我对预填充的看法是Core Data被设计为闭环系统.您可以使用Core Data轻松填充数据文件.填充Core Data SQLite文件并不比编写脚本将Oracle数据转换为CSV格式更困难.
如果你留在Cocoa和核心数据中,那就不难了.您编写命令行应用程序或编辑应用程序并导入数据.从Cocoa程序员的PoV来看,这是一项简单的任务,只需几分钟.
| 归档时间: |
|
| 查看次数: |
2187 次 |
| 最近记录: |