WWW.BOOK.DISLIB.INFO
FREE ELECTRONIC LIBRARY - Books, dissertations, abstract
 
<< HOME
CONTACTS



Pages:     | 1 || 3 | 4 |   ...   | 27 |

«Introduction to Core Data Programming Guide 11 Who Should Read This Document 11 Organization of This Document 11 See Also 13 Technology Overview 14 ...»

-- [ Page 2 ] --

“Creating and Deleting Managed Objects” (page 56) describes how to correctly instantiate and delete ● managed objects programmatically.

2012-09-19 | Copyright © 2004, 2012 Apple Inc. All Rights Reserved.

Introduction to Core Data Programming Guide Organization of This Document “Fetching Managed Objects” (page 61) describes how to fetch managed objects, and some considerations ● to ensure that fetches are efficient.

“Using Managed Objects” (page 67) describes issues related to manipulating managed objects in your ● application.

“Object Lifetime Management” (page 79) describes aspects of memory management when using Core ● Data.

“Relationships and Fetched Properties” (page 82) describes relationships, how to model them, and issues ● related to manipulating relationships between managed objects. It also describes fetched properties, which are like weak unidirectional relationships.

“Non-Standard Persistent Attributes” (page 91) describes how to use attributes with non-standard value ● types (such as colors and C-structures).

“Managed Object Validation” (page 103) describes types of validation, how to implement validation methods, ● and when to use validation.

“Faulting and Uniquing” (page 110) describes how Core Data constrains the size of the object graph, and ● ensures that each managed object within a managed object context is unique.

“Using Persistent Stores” (page 115) describes how you create a persistent store, how you can migrate a ● store from one type to another, and manage store metadata.

“Core Data and Cocoa Bindings” (page 120) describes how Core Data integrates with and leverages Cocoa ● bindings.

“Change Management” (page 124) describes the issues that may arise if you create multiple managed ● object contexts or multiple persistence stacks.

“Persistent Store Features” (page 130) describes the features of the different types of store, and how you ● can configure the behavior of the SQLite store.

“Concurrency with Core Data” (page 136) describes how to use concurrent programming in a Core Data ● application.

“Core Data Performance” (page 140) describes techniques you can use to ensure a Core Data application ● is as efficient as possible.

“Troubleshooting Core Data” (page 149) describes common errors developers make when using Core Data, ● and how to correct them.

“Efficiently Importing Data” (page 160) describes how you can import data into a Core Data application.

● “Core Data FAQ” (page 165) provides answers to questions frequently asked about Core Data.

● “Glossary” (page 176) provides a glossary of terms used in Core Data.

–  –  –

See Also

You should also refer to:

Core Data Starting Point ● Core Data Tutorial for iOS ● Core Data Utility Tutorial ● Core Data Model Editor Help ●

–  –  –

This article describes the basic features provided by Core Data, and reasons why it might be appropriate for you to adopt the technology.

Core Data Features The Core Data framework provides generalized and automated solutions to common tasks associated with

object life-cycle and object graph management, including persistence. Its features include:

Change tracking and undo support.

● Core Data provides built-in management of undo and redo beyond basic text editing.

Relationship maintenance.

● Core Data manages change propagation, including maintaining the consistency of relationships among objects.

Futures (faulting).

● Core Data can reduce the memory overhead of your program by lazily loading objects. It also supports partially materialized futures, and copy-on-write data sharing.

Automatic validation of property values.

● Core Data’s managed objects extend the standard key-value coding validation methods that ensure that individual values lie within acceptable ranges so that combinations of values make sense.

Schema migration.

● Dealing with a change to your application’s schema can be difficult, in terms of both development effort and runtime resources. Core Data’s schema migration tools simplify the task of coping with schema changes, and in some cases allow you to perform extremely efficient in-place schema migration.

Optional integration with the application’s controller layer to support user interface synchronization.

● Core Data provides the NSFetchedResultsController object on iOS, and integrates with Cocoa Bindings on OS X.

Full, automatic, support for key-value coding and key-value observing.

● In addition to synthesizing key-value coding and key-value observing compliant accessor methods for attributes, Core Data synthesizes the appropriate collection accessors for to-many relationships.

–  –  –

Grouping, filtering, and organizing data in memory and in the user interface.

● Automatic support for storing objects in external data repositories.

● Sophisticated query compilation.

● Instead of writing SQL, you can create complex queries by associating an NSPredicate object with a fetch request. NSPredicate provides support for basic functions, correlated subqueries, and other advanced SQL. With Core Data, it also supports proper Unicode, locale-aware searching, sorting, and regular expressions.





Merge policies.

● Core Data provides built in version tracking and optimistic locking to support automatic multi-writer conflict resolution.

Why Should You Use Core Data?

There are a number of reasons why it may be appropriate for you to use Core Data. One of the simplest metrics is that, with Core Data, the amount of code you write to support the model layer of your application is typically 50% to 70% smaller as measured by lines of code. This is primarily due to the features listed above—the features Core Data provides are features you don’t have to implement yourself. Moreover they’re features you don’t have to test yourself, and in particular you don’t have to optimize yourself.

Core Data has a mature code base whose quality is maintained through unit tests, and is used daily by millions of customers in a wide variety of applications. The framework has been highly optimized over several releases.

It takes advantage of information provided in the model and runtime features not typically employed in application-level code. Moreover, in addition to providing excellent security and error-handling, it offers best memory scalability of any competing solution. Put another way: you could spend a long time carefully crafting your own solution optimized for a particular problem domain, and not gain any performance advantage over what Core Data offers for free for any application.

In addition to the benefits of the framework itself, Core Data integrates well with the OS X tool chain. The model design tools allow you to create your schema graphically, quickly and easily. You can use templates in the Instruments application to measure Core Data’s performance, and to debug various problems. On OS X desktop, Core Data also integrates with Interface Builder to allow you to create user interfaces from your model.

These aspects help to further shorten your application design, implementation, and debugging cycles.

What Core Data Is Not Having given an overview of what Core Data is and does, and why it may be useful, it is also useful to correct some common misperceptions and state what it is not.

–  –  –

Core Data is not a relational database or a relational database management system (RDBMS).

● Core Data provides an infrastructure for change management and for saving objects to and retrieving them from storage. It can use SQLite as one of its persistent store types. It is not, though, in and of itself a database. (To emphasize this point: you could for example use just an in-memory store in your application.

You could use Core Data for change tracking and management, but never actually save any data in a file.) Core Data is not a silver bullet.

● Core Data does not remove the need to write code. Although it is possible to create a sophisticated application solely using the Xcode data modeling tool and Interface Builder, for more real-world applications you will still have to write code.

Core Data does not rely on Cocoa bindings.

● Core Data integrates well with Cocoa bindings and leverages the same technologies—and used together they can significantly reduce the amount of code you have to write—but it is possible to use Core Data without bindings. You can readily create a Core Data application without a user interface (see Core Data Utility Tutorial ).

–  –  –

This article describes the basic Core Data architecture, and the way you use the framework.

Basic Core Data Architecture In most applications, you need a means to open a file containing an archive of objects, and a reference to at least one root object. You also need to be able to archive all the objects to a file and—if you want to support undo—to track changes to the objects. For example, in an employee management application, you need a means to open a file containing an archive of employee and department objects, and a reference to at least one root object—for example, the array of all employees—as illustrated in Figure 1 (page 18). You also need to be able to archive to a file all the employees and all the departments.

2012-09-19 | Copyright © 2004, 2012 Apple Inc. All Rights Reserved.

Core Data Basics Basic Core Data Architecture Note : This document uses the employees example for reasons of expediency and clarity. It represents a rich but easily understood problem domain. The utility of the Core Data framework, however, is not restricted to database-style applications, nor is there an expectation of client-server behavior.

The framework is equally useful as the basis of a vector graphics application such as Sketch or a presentation application such as Keynote.

You are responsible for writing the code that manages these tasks either in whole or in part. For example, on OS X desktop, the Cocoa document architecture provides an application structure and functionality that helps to reduce the burden, but you still have to write methods to support archiving and unarchiving of data, to keep track of the model objects, and to interact with an undo manager to support undo.

Figure 1 Document management using the standard Cocoa document architecture

–  –  –

Using the Core Data framework, most of this functionality is provided for you automatically, primarily through an object known as a managed object context (or just “context”). The managed object context serves as your gateway to an underlying collection of framework objects—collectively known as the persistence stack—that mediate between the objects in your application and external data stores. At the bottom of the stack are persistent object stores, as illustrated in Figure 2 (page 19).

Figure 2 Document management using Core Data Core Data is not restricted to document-based applications—indeed it is possible to create a Core Data–based utility with no user interface at all (see Core Data Utility Tutorial ). The same principles apply in other applications.

–  –  –

Managed Objects and Contexts You can think of a managed object context as an intelligent scratch pad. When you fetch objects from a persistent store, you bring temporary copies onto the scratch pad where they form an object graph (or a collection of object graphs). You can then modify those objects however you like. Unless you actually save those changes, however, the persistent store remains unaltered.

Model objects that tie into in the Core Data framework are known as managed objects. All managed objects must be registered with a managed object context. You add objects to the graph and remove objects from the graph using the context. The context tracks the changes you make, both to individual objects' attributes and to the relationships between objects. By tracking changes, the context is able to provide undo and redo support for you. It also ensures that if you change relationships between objects, the integrity of the object graph is maintained.



Pages:     | 1 || 3 | 4 |   ...   | 27 |


Similar works:

«PIPETMAN P ® ENGLISH PIPETMAN P ® CONTENTS page 1 INTRODUCTION 2 2 PARTS CHECK LIST 3 3 DESCRIPTION 4 4 OPERATING RANGES 5 5 SETTING THE VOLUME 5 6 PIPETTING 7 ® 7 GILSON DIAMOND TIPS 10 8 PERSONALIZING YOUR PIPETTE 12 9 GLP FEATURES 13 10 TROUBLESHOOTING 13 11 LEAK TEST 15 12 MAINTENANCE 16 13 CLEANING AND DECONTAMINATION 20 14 SPECIFICATIONS 22 15 SPARE PARTS 24 1 INTRODUCTION Congratulations on acquiring your new Pipetman P. Enjoy the following features. Continuously-adjustable, designed...»

«Breaking Dawn Stephenie Meyer Copyright © 2008 by Stephenie Meyer All rights reserved. Except as permitted under the U.S. Copyright Act of 1976, no part of this publication may be reproduced, distributed, or transmitted in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. Little, Brown and Company Hachette Book Group USA 237 Park Avenue, New York, NY 10017 Visit our Web site at www.lb-teens.com First eBook Edition:...»

«UNITED STATES OF AMERICA Before the SECURITIES AND EXCHANGE COMMISSION SECURITIES EXCHANGE ACT OF 1934 Release No. 77288 / March 3, 2016 ADMINISTRATIVE PROCEEDING File No. 3-17152 ORDER INSTITUTING CEASE-ANDIn the Matter of DESIST PROCEEDINGS PURSUANT TO SECTION 21C OF THE SECURITIES MIKHAIL GOUREVITCH, EXCHANGE ACT OF 1934, MAKING FINDINGS, AND IMPOSING A CEASERespondent. AND-DESIST ORDER I. The Securities and Exchange Commission (“Commission”) deems it appropriate that ceaseand-desist...»

«M a r i a n a Va l v e r d e BEYOND DISCIPLINE AND PUNISH: FOUCAULT’S CHALLENGE TO CRIMINOLOGY Published in English thirty years ago, Discipline and Punish has exercised a profound and lasting influence on criminological thinking and research (Foucault 1978). Appearing when Marxist criminology was beginning to decline, Foucault’s book, and subsequent accounts and uses of Foucault’s ideas, breathed new life into critical criminology at a time when—apart from feminism—there was little...»

«1 2 Lars E. Kroll, Thomas Lampert, Cornelia Lange, Thomas Ziese 3, 4 Entwicklung und Einflussgrößen der gesunden Lebenserwartung 1 Robert Koch-Institut, Wiss. Mitarbeiter im Fachgebiet Gesundheitsberichterstattung, Seestr. 10, 13353 Berlin, E-Mail: L.Kroll@rki.de 2 Robert Koch-Institut, Stv. Leiter des Fachgebiets Gesundheitsberichterstattung, Seestr. 10, 13353 Berlin, EMail: T.Lampert@rki.de 3 Robert Koch-Institut, Leiterin des Fachgebiets Gesundheitsmonitoring, Seestr. 10, 13353 Berlin,...»

«The Earth System Curator: integration technology for models and data ESMF Community Meeting, Boulder V. Balaji (balaji@princeton.edu)1 1 Princeton University NOAA/GFDL 30 May 2007 Balaji et al (NOAA/GFDL) Curator 30 May 2007 1 / 23 Outline What is a curator Convergence of models and data Model and grid metadata Curator use cases Dynamically derived data catalogues Offline models Branch runs Curator implementations GFDL Curator and CDP Curator FRE: a prototype for CRE Links with ESMF and MAPL...»

«CAS Data Protection Regulations I. General Data protection CAS Software AG aims to respect and protect your privacy. We have designed our website so that you can visit the web pages of CAS Software AG (hereinafter referred to as website) without being personally identifiable and without any personal information about you being disclosed. If you decide to disclose personal information to us, we undertake to treat it with great care. Personal data The term 'personal data' refers to items of...»

«Assessing the European Water Stewardship Standard in the Context of the EU Water Framework Directive – A Case Study of the Applicability and Acceptance on a Farm Level Diplomarbeit für die Diplomprüfung zur Erlangung des Grades: Diplomagraringenieurin (Dipl.-Ing.agr.) der Landwirtschaftlichen Fakultät der Rheinischen Friedrich-Wilhelms-Universität zu Bonn Vorgelegt am 30. Juni 2012 von cand. agr. Susanne Eva Maria Ziegler 1. Prüfer: Prof. Dr. Ulrich Köpke 2. Prüfer: Prof. Dr. Olaf...»

«Gerd Spittler Arbeit zur Sprache bringen der ethnographische Zugang Vienna 2014 ISSN 2311-231X Rathausstraße 19/9, 1010 – Vienna, Austria Tel: +43-1-4277-499 01, Fax: +43-1-4277-9499 methods.univie.ac.at ARBEIT ZUR SPRACHE BRINGEN – DER ETHNOGRAPHISCHE ZUGANG 1 Gerd Spittler (Universität Bayreuth) VIENNA WORKING PAPERS IN ETHNOGRAPHY Zusammenfassung Reden über Arbeit und tatsächliches Arbeitshandeln (Arbeitspraxis) klaffen oft weit auseinander. Wie können wir letzteres methodisch...»

«Institute of Biomechanics and Orthopaedics German Sport University, Cologne Motor behaviour during sudden perturbation and repetitive non-strategic tasks in consideration of muscle-tendon unit capacities: effects of aging and running Approved thesis submitted for the degree PhD in Biomechanics by Kiros Karamanidis from Neohori Orestiada / Greece Cologne, 2006 First referee: PD Dr. Adamantios Arampatzis Second referee: Prof. Dr. Gert-Peter Brüggemann Chair of the doctorate committee: Prof. Dr....»





 
<<  HOME   |    CONTACTS
2016 www.book.dislib.info - Free e-library - Books, dissertations, abstract

Materials of this site are available for review, all rights belong to their respective owners.
If you do not agree with the fact that your material is placed on this site, please, email us, we will within 1-2 business days delete him.