Object graph: Difference between revisions

Content deleted Content added
"UML" capitalization
No edit summary
 
(22 intermediate revisions by 20 users not shown)
Line 1:
{{short description|Network representation of the relationships between objects in a program}}
{{Unreferenced|date=October 2009}}
{{mi|
{{Inappropriate tone|date=December 2007}}
{{Unreferenced|date=OctoberNovember 20092014}}
{{Inappropriate tone|date=DecemberNovember 20072014}}}}
 
In [[computer science]], in an [[Object-oriented programming|object-oriented program]], groups of [[Object (computer science)|objects]] form a network through their relationships with each other, either through a direct [[Reference (computer science)|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 [[Graph (discrete mathematics)|graphs]] studied in [[graph theory]].
 
An '''Objectobject graph''' is a view of an [[object system]] at a particular point in time. WhereasUnlike a normal [[data model]] such as ana [[UMLUnified Modeling Language]] (UML) [[Classclass diagram]], which details the relationships between objects[[Class (computer programming)|classes]], the object graph relates their [[Instance (computer science)|instances]]. [[Object diagram|Object diagrams]]s are subsetsubsets of the overall object graph.
 
An '''Object graph''' is a view of an object system at a particular point in time. Whereas a normal [[data model]] such as an [[UML]] [[Class diagram]] details the relationships between objects, the object graph relates their instances. [[Object diagram|Object diagrams]] are subset 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.
 
==Physical representation==
An object graph is a [[directed graph]], which might be [[Cycle graph|cyclic]]. When stored in [[Random access memory|RAM]], objects occupy different segments of the memory with their attributes and function table, while relationships are represented by [[Pointer_pointer (computingcomputer programming)|pointerspointer]]s 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, backLeftback Left and backRight.back Right.
{{Expand|date=March 2007}}
An example of an [[adjacency list]] representation might be something as follows:
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, backLeft and backRight.
 
Example of an [[adjacency list]] representation: c:Car → {frontLeft:Wheel, frontRight:Wheel, backLeft:Wheel, backRight:Wheel}.
c:Car → {front Left:Wheel, front Right:Wheel, back Left:Wheel, back Right:Wheel}.
 
==See also==
Line 18 ⟶ 24:
 
{{DEFAULTSORT:Object Graph}}
 
[[Category:Data modeling diagrams]]