MagicalRecord README

The project's README from github.com/magicalpanda/MagicalRecord. As one markdown file: README.md.

Awesome MagicalRecord

Circle CI

In software engineering, the active record pattern is a design pattern found in software that stores its data in relational databases. It was named by Martin Fowler in his book Patterns of Enterprise Application Architecture. The interface to such an object would include functions such as Insert, Update, and Delete, plus properties that correspond more-or-less directly to the columns in the underlying database table.

Active record is an approach to accessing data in a database. A database table or view is wrapped into a class; thus an object instance is tied to a single row in the table. After creation of an object, a new row is added to the table upon save. Any object loaded gets its information from the database; when an object is updated, the corresponding row in the table is also updated. The wrapper class implements accessor methods or properties for each column in the table or view.

- Wikipedia

MagicalRecord was inspired by the ease of Ruby on Rails' Active Record fetching. The goals of this code are:

Status of the project

This project's activity has stopped, superseded by Core Data itself. Our latest versions available are:

Documentation

Support

This project's activity has stopped. MagicalRecord is provided as-is, free of charge. For support, you have a few choices:

MagicalRecord (magicalpanda/MagicalRecord)

Searching Database…

这是什么?MagicalRecord 是一个 Objective-C 库,简化 iOS 和 macOS 上 Core Data 的使用,让你用干净的一行代码完成查询、保存和实体创建,取代冗长的 NSFetchRequest 模板代码。
它是我用来搭建应用主体的框架,还是只是 Core Data 之上的一组辅助方法?它是一个轻量级库,由类别方法和辅助工具组成,架在 Apple 现有的 Core Data 栈之上,遵循 Ruby on Rails 推广的 Active Record 模式。
怎么把它加进项目?通过 CocoaPods 安装,在 Podfile 里写上 pod 'MagicalRecord',可以指向 2.4.0 这样的具体标签;想要实验版就指向 3.0 的某个分支。
需要先搭好 Core Data 吗,还是它会取代 Core Data?底层仍然用 Apple 的 Core Data 框架;MagicalRecord 只是把托管对象上下文、查询、保存和导入这些调用封装得更简短。
这个项目还在维护吗?不在了,开发已完全停止,因为 Apple 自身对 Core Data 的改进让这个封装不再那么必要;它按原样保留,没有积极支持。
iPhone 和 Mac 应用都能用吗?能,iOS 和 macOS 项目都能使用,因为两者依赖的是同一个 MagicalRecord 所封装的 Core Data 栈。
除查询之外,MagicalRecord 还简化了哪些操作?根据它的文档主题列表,除查询之外,它还覆盖创建实体、删除实体、保存上下文、导入数据和管理托管对象上下文。
如今的新项目还应该用 MagicalRecord 吗?新项目最好不要;README 明确说明项目活动已经停止、被 Core Data 自身的改进所取代,它主要用于维护遗留代码库。
Size
8 MB
Stars
10.7K
Age
16y
Commits · 90 Days