Skip to content

Dependents

Lszaboo edited this page Nov 9, 2025 · 3 revisions

Dependent class

As the wiki discussed in previous pages, Juliagebra relies on a Dependency graph to manage itself, so we have to have a class for the nodes, and they are called and implemented by the Dependent abstract class.

This class is designed as abstract, because by itself it can't function in the graph. It has some abstract methods which must be specialized by inheriting from this class. So if one would like to add their own nodes to the graph, they would have to inherit from Dependent and have to define it's abstract methods.

Structure

Let's take a look at how this class is defined:

mutable struct Dependent
    _graphID::Int                       
    _graphParents::Vector{DependentDNA}   
    _dependentChain::DependentChain
    _callback::Function
end

As we can see, every Dependent will be assigned to a graph via _graphID.

We also store who this node depends on in the Dependent graph (who has to be updated before updating this Node) in _graphParents.

The _callback function stores how the Dependent should react, when it is updated, evaluated in the Dependency graph.

DependentChain

The Dependent class also has a field with type DependentChain.

This object stores a reference to every other Dependent, Observed, Observers which have to be evaluated, updated, when an instance of this dependent is evaluated as a source node.

This object stores for efficient graph evaluation the Dependents and Observervers in a special way.

Functionality passed to children

Functions to override

Wiki navigation sidebar

Legend:

  • ✅: Up-to-date
  • 🏗️: Needs some work
  • ❌: Unusable
  1. 🏗️ Home
  2. 🏗️ Developer Guide
    1. Composition Subclassing
    2. Core Graph
    3. 🏗️ Dependents
    4. 🏗️ Observer and Observed
    5. 🏗️ Plans
    6. 🏗️ Rendered Dependents
    7. Macro Constructors

Clone this wiki locally