• <tfoot id='InWQW'></tfoot>

      <small id='InWQW'></small><noframes id='InWQW'>

      • <bdo id='InWQW'></bdo><ul id='InWQW'></ul>

    1. <i id='InWQW'><tr id='InWQW'><dt id='InWQW'><q id='InWQW'><span id='InWQW'><b id='InWQW'><form id='InWQW'><ins id='InWQW'></ins><ul id='InWQW'></ul><sub id='InWQW'></sub></form><legend id='InWQW'></legend><bdo id='InWQW'><pre id='InWQW'><center id='InWQW'></center></pre></bdo></b><th id='InWQW'></th></span></q></dt></tr></i><div id='InWQW'><tfoot id='InWQW'></tfoot><dl id='InWQW'><fieldset id='InWQW'></fieldset></dl></div>
      <legend id='InWQW'><style id='InWQW'><dir id='InWQW'><q id='InWQW'></q></dir></style></legend>

        核心数据与 SQLite 3

        时间:2023-09-17

          1. <tfoot id='XZ3Sf'></tfoot>

            1. <legend id='XZ3Sf'><style id='XZ3Sf'><dir id='XZ3Sf'><q id='XZ3Sf'></q></dir></style></legend>
                <tbody id='XZ3Sf'></tbody>

              <small id='XZ3Sf'></small><noframes id='XZ3Sf'>

              • <i id='XZ3Sf'><tr id='XZ3Sf'><dt id='XZ3Sf'><q id='XZ3Sf'><span id='XZ3Sf'><b id='XZ3Sf'><form id='XZ3Sf'><ins id='XZ3Sf'></ins><ul id='XZ3Sf'></ul><sub id='XZ3Sf'></sub></form><legend id='XZ3Sf'></legend><bdo id='XZ3Sf'><pre id='XZ3Sf'><center id='XZ3Sf'></center></pre></bdo></b><th id='XZ3Sf'></th></span></q></dt></tr></i><div id='XZ3Sf'><tfoot id='XZ3Sf'></tfoot><dl id='XZ3Sf'><fieldset id='XZ3Sf'></fieldset></dl></div>
                  <bdo id='XZ3Sf'></bdo><ul id='XZ3Sf'></ul>

                  本文介绍了核心数据与 SQLite 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我对关系数据库已经很熟悉了,并且已经使用过SQLite(和其他数据库)过去.不过,Core Data 有一定的吸引力,所以考虑花点时间学习一下使用在我的下一个申请中.

                  I am already quite familiar with relational databases and have used SQLite (and other databases) in the past. However, Core Data has a certain allure, so I am considering spending some time to learn it for use in my next application.

                  与 SQLite 相比使用 Core Data 是否有很多好处,反之亦然?各自的优缺点是什么?

                  Is there much benefit to using Core Data over SQLite, or vice versa? What are the pros/cons of each?

                  当 Apple 没有将 Core Data 用于其许多旗舰应用程序(例如 Mail.app 或 iPhoto.app)而是选择 SQLite 数据库时,我发现很难证明学习 Core Data 的成本是合理的.SQLite 也广泛用于 iPhone.

                  I find it hard to justify the cost of learning Core Data when Apple doesn't use it for many of its flagship applications like Mail.app or iPhoto.app - instead opting for SQLite databases. SQLite is also used extensively on the iPhone.

                  熟悉使用这两种方法的人能否评价一下他们的体验?或许,与大多数事情一样,这个问题比仅使用一个比另一个更深?

                  Can those familiar with using both comment on their experience? Perhaps, as with most things, the question is deeper than just using one over the other?

                  推荐答案

                  虽然 Core Data 是 Apple 的后代Enterprise Object Framework,一个对象关系映射器 (ORM),与关系后端紧密相连,Core Data 不是一个 ORM.事实上,它是一个对象图管理框架.它管理一个潜在的非常大的对象实例图,允许应用程序通过根据需要在内存中和内存外故障对象来处理不完全适合内存的图.Core Data 还管理对属性和关系的约束并维护引用完整性(例如,当对象被添加到/从关系中删除/从关系中删除时,保持前向和后向链接一致).因此,Core Data 是构建 MVC 架构的模型"组件的理想框架.

                  Although Core Data is a descendant of Apple's Enterprise Object Framework, an object-relational mapper (ORM) that was/is tightly tied to a relational backend, Core Data is not an ORM. It is, in fact, an object graph management framework. It manages a potentially very large graph of object instances, allowing an app to work with a graph that would not entirely fit into memory by faulting objects in and out of memory as necessary. Core Data also manages constraints on properties and relationships and maintains reference integrity (e.g. keeping forward and backward links consistent when objects are added/removed to/from a relationship). Core Data is thus an ideal framework for building the "model" component of an MVC architecture.

                  为了实现图形管理,Core Data 碰巧使用 SQLite 作为磁盘存储.它可以使用不同的关系数据库甚至非关系数据库(例如CouchDB<)实现/a>.正如其他人指出的那样,Core Data 也可以使用 XML 或二进制格式或用户编写的原子格式作为后端(尽管这些选项要求整个对象图适合内存).如果您对如何在 SQLite 后端实现 Core Data 感兴趣,您可能需要查看 OmniGroup 的 OmniDataObjects 框架,一个核心数据 API 子集的开源实现.BaseTen 框架也是使用 PostgreSQL 作为后端的 Core Data API 的实现.

                  To implement its graph management, Core Data happens to use SQLite as a disk store. It could have been implemented using a different relational database or even a non-relational database such as CouchDB. As others have pointed out, Core Data can also use XML or a binary format or a user-written atomic format as a backend (though these options require that the entire object graph fit into memory). If you're interested in how Core Data is implemented on an SQLite backend, you might want to check out OmniGroup's OmniDataObjects framework, an open source implementation of a subset of the Core Data API. The BaseTen framework is also an implementation of the Core Data API using PostgreSQL as a backend.

                  因为 Core Data 不是 SQLite 的 ORM,它不能读取任意 SQLite 模式.相反,您不应该依赖于能够使用其他 SQLite 工具读取 Core Data 的 SQLite 数据存储;架构是一个可能会改变的实现细节.

                  Because Core Data is not intended to be an ORM for SQLite, it cannot read arbitrary SQLite schema. Conversely, you should not rely on being able to read Core Data's SQLite data stores with other SQLite tools; the schema is an implementation detail that may change.

                  因此,直接使用 Core Data 或 SQLite 之间并没有真正的冲突.如果您需要关系数据库,请使用 SQLite(直接或通过 Objective-C 包装器之一,例如 FMDB) 或关系数据库服务器.但是,您可能仍想学习 Core Data 以用作对象图管理框架.结合 Apple 的控制器类和键值绑定兼容的视图小部件,您可以用非常的代码实现完整的 MVC 架构.

                  Thus, there is not really any conflict between using Core Data or SQLite directly. If you want a relational database, use SQLite (directly or via one of the Objective-C wrappers such as FMDB), or a relational database server. However, you may still want to learn Core Data for use as an object graph management framework. In combination with Apple's controller classes and key-value binding compatible view widgets, you can implement a complete MVC architecture with very little code.

                  这篇关于核心数据与 SQLite 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何查看在 Azure SQL 服务器实例中授予任何数据库用户的角色和权限? 下一篇:适用于 Mac OS X 的 SQL 客户端,可与 MS SQL Server 配合使用

                  相关文章

                  1. <legend id='bMGAd'><style id='bMGAd'><dir id='bMGAd'><q id='bMGAd'></q></dir></style></legend>

                      <small id='bMGAd'></small><noframes id='bMGAd'>

                    1. <i id='bMGAd'><tr id='bMGAd'><dt id='bMGAd'><q id='bMGAd'><span id='bMGAd'><b id='bMGAd'><form id='bMGAd'><ins id='bMGAd'></ins><ul id='bMGAd'></ul><sub id='bMGAd'></sub></form><legend id='bMGAd'></legend><bdo id='bMGAd'><pre id='bMGAd'><center id='bMGAd'></center></pre></bdo></b><th id='bMGAd'></th></span></q></dt></tr></i><div id='bMGAd'><tfoot id='bMGAd'></tfoot><dl id='bMGAd'><fieldset id='bMGAd'></fieldset></dl></div>
                        <bdo id='bMGAd'></bdo><ul id='bMGAd'></ul>
                      <tfoot id='bMGAd'></tfoot>