Telerik OpenAccess Classic

Telerik OpenAccess ORM Send comments on this topic.
Object Navigation
Programmer's Guide > OpenAccess ORM Classic (Old API) > Programming With OpenAccess > Query a Data Model > Object Navigation

Glossary Item Box

This documentation article is a legacy resource describing the functionality of the deprecated OpenAccess Classic only. The contemporary documentation of Telerik OpenAccess ORM is available here.

Object navigation is the concept of locating the objects in a database (and the information they contain) by resolving the references that one object has to another. Being able to follow references from one object to another is perhaps the most important aspect of an object-oriented view of a database.

For example, a Product object can have a reference (a data-member) to a Supplier object that represents the supplier of the product. Supplier objects can have a collection object that contains references to all products that the supplier is managing. If you start with a product and navigate references, you can find all the other products in the database managed by the same supplier. When you start modeling sophisticated data relationships, object graphs can become far more complex than shown in this simple example.

Persistence by Reachability

For an object to be persistent in .NET, the class needs to be declared as persistence capable using the [OpenAccess.Persistent] attribute for the class definition. However, this does not mean that all instances of the class that you create in an application are automatically stored in the database. To explicitly make an instance of a persistence capable class you call the method IObjectScope.Add(). However, it is likely that very few objects will need to be made persistent in this way. In order to maintain object relationships in the database, all classes that are referenced by other persistent classes must also be persistent, i.e., stored in the database. So, all objects that are reachable from (referenced by) other persistent classes automatically become persistent when the referencing object is stored. This is referred to as persistence by reachability.

For example, if you are implementing a data storage system for a Computer Aided Design (CAD) system, you may need to store the master drawings explicitly. A master drawing is most likely located at the top of a hierarchy of sub-drawings. Each sub-drawing consists of smaller drawings depicting the individual components that make up the whole. When you store the master drawing or one of the sub-drawings, persistence-by-reachability ensures that all referenced drawings are also stored.