CEDA Presentation 2007

prev | next

Slide 14 : Dependency Graph System

CEDA features an advanced Dependency Graph System (DGS) to support the lazy and efficient recalculation of dependent values (ie caches). The algorithm is incremental in the sense that it only recalculates caches that have been marked as dirty. It is lazy in the sense that a cache is only calculated when its value is required.

This system eliminates the need for the programmer to be concerned with the Observer Pattern (a well known design pattern used by programmers to update dependents), and the need for attaching and detaching observers. The DGS uses read barriers on data model fields and dependent nodes to automatically build the dependency graph and maintain it as dependencies change over time. Many of the dangers of using the observer pattern are avoided – such as dirty reads.

The DGS detects early quiescence – which is where a recalculated variable ends up with the same value as it had before. In that case the DGS is able to avoid the recalculation of downstream nodes even though they had been marked as dirty.

The DGS works at the granularity of fields (ie member variables) within objects.

CEDA2 features a simple and elegant syntax for declaring dependent fields, and providing arbitrary C++ code that is executed to calculate the field value.