School Boy
School Boy

Reputation: 1183

What is the Difference between Object tree and Object Graph in Programming (Mainly OOPS)?

I know the concept of Object Graph (its the graphical representation of the relationship between the objects). (usage:- Garbage collection)

  1. However, I dont know the exact Meaning and usage of Object tree.

  2. Also I am in confusion that what could be the main difference between the Object tree and Object Graph(if any body can give the example with respect to OOPS domain then it would much more helpfull).

Upvotes: 4

Views: 1102

Answers (1)

aioobe
aioobe

Reputation: 421090

To me an object graph is an ordinary collection of objects with references in between.

An object tree is pretty much the same except that the references form a tree and all point in the direction of a certain (root) object.

A quote from Wikipedia:

A directed tree is a directed graph which would be a tree if the directions on the edges were ignored. Some authors restrict the phrase to the case where the edges are all directed towards a particular vertex, or all directed away from a particular vertex

Upvotes: 4

Related Questions