Object graph

Short description: Network representation of the relationships between objects in a program

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)

This article's tone or style may not reflect the encyclopedic tone used on Wikipedia. See Wikipedia's guide to writing better articles for suggestions. (November 2014) (Learn how and when to remove this template message)

|

(Learn how and when to remove this template message)

In computer science, 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, after the mathematical objects called graphs studied in graph theory.[1][2]

An object graph is a view of an object system at a particular point in time. Unlike a normal data model such as a Unified Modeling Language (UML) class diagram, which details the relationships between classes, the object graph relates their instances. Object diagrams are subsets of the overall object graph.

Object-oriented applications contain complex webs of interrelated objects. Objects are linked to each other by one object either owning or containing another object or holding a reference to another object. This web of objects is called an object graph and it is the more abstract structure that can be used in discussing an application's state.

## Contents

* 1 Physical representation
* 2 Examples
* 3 See also
* 4 References

## Physical representation

An object graph is a directed graph, which might be cyclic. When stored in RAM, objects occupy different segments of the memory with their attributes and function table, while relationships are represented by pointers or a different type of global handler in higher-level languages.

## Examples

For instance, a Car class can compose a Wheel one. In the object graph a Car instance will have up to four links to its wheels, which can be named frontLeft, frontRight, back Left and back Right. An example of an adjacency list representation might be something as follows:

c:Car → {front Left:Wheel, front Right:Wheel, back Left:Wheel, back Right:Wheel}.

## See also

* Data model
* Object diagram

## References

1. ↑ Potter, John; Noble, James; Clarke, David (1998). "The ins and outs of objects". Proceedings 1998 Australian Software Engineering Conference (Cat. No.98EX233). Adelaide, SA, Australia. pp. 80–89. doi:10.1109/ASWEC.1998.730915. Bibcode: 1998aswe.conf....9P. https://lirias.kuleuven.be/handle/123456789/203458.
2. ↑ Campbell, Matthew (2012). "Working with Object Graphs" (in en). Objective-C Recipes: A Problem-Solution Approach. Apress. pp. 283–338. ISBN 978-1-4302-4372-4.

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Object graph. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Object_graph&oldid=4572281"