Sync Services Schemas
The data handled by the Sync Services framework must be described by a sync schema that details the specifics about the data handled by the sync engine. These models are entity-relationship models and follow the same concepts used by the Core Data framework. These concepts are:
Entity An entity describes a discrete unit of data. For example, a person, a bookmark, or a to-do item. The name of each entity managed by Sync Services must be unique. For example,
com.apple.contacts.PhoneNumber.
Attribute An attribute represents a component of an entity. For example, a person entity would have a first name and a last name attribute. These are usually simple types like strings or numbers, or collection types such as arrays and dictionaries.
Relationship A relationship describes an connection that an entity can have to other entities. These relationships can be optional or required as well as one-to-one or one-to-many. For example, a relationship can specify that a contact can have multiple phone numbers and require that every number have an associated contact.
Data Class A data class is a logical grouping of related entities, typically one that makes sense to a user. For example, a group of contacts.
写Sync应用,首先要理解以上4个术语,这四个术语用于构建同步的schema.只有充分理解,方能写出正确的schema
阅读(1004) | 评论(0) | 转发(0) |