SQS
SQS

Reputation: 35

What do apple refer to as the object graph in the context of Core Data?

In their tutorial they say

"When you fetch objects from a persistent store, you bring temporary copies onto the scratch pad where they form an object graph"

What do they exactly mean by "Object Graph"? Can I maybe log this graph so it will be clearer?

Upvotes: 1

Views: 1194

Answers (2)

Lorenzo B
Lorenzo B

Reputation: 33428

This is a concept not only related to Core Data but to Object Oriented programming in general. Here I quote the Cocoa Core Competencies documentation (in bold relevant parts).

In an object-oriented program, groups of objects form a network through their relationships with each other—either through a direct reference to another object or through a chain of intermediate references. These groups of objects are referred to as object graphs. Object graphs may be small or large, simple or complex. An array object that contains a single string object represents a small, simple object graph. A group of objects containing an application object, with references to the windows, menus and their views, and other supporting objects, may represent a large, complex object graph.

To provide an overview of what Core Data is (or not is) I really suggest to take a look to Core Data Overview by Daniel Eggert.

Hope it helps.

Upvotes: 0

David Berry
David Berry

Reputation: 41226

"Object Graph" refers to the fact that although CoreData can be used as a database storing a collection of records and is implemented on top of such a database, it is really much more than that. It manages, stores, and reloads, a complex graph (in the math sense, a bunch of entities with arbitrary connections) of objects with arbitrary relationships.

It's not a "graph" in the sense of a graph in Excel, it's a graph in the stricter sense of a set of objects with arbitrary connections.

Upvotes: 3

Related Questions