Architecture Enablers
Hiperspace use lazy loading for all references, but unlike a lazy-loading Object-Relational-Mapping references in Hiperspace have low latency
KeyRef
KeyRef is used to hold a reference from an Entity / Segment / Aspect to the underlying object in Hiperspace, with Lazy Loading
RefSingle
RefSingle is a variation of KeyRef for Aspect references that inherit the key from the Entity / Segment / Aspect
RefSet
RefSet is a set of references to objects in a SubSpace with lazy loading. Once referenced, the results are cached
For the trivial Cousins Problem
%domain (Cousins);
%function (unary, relation, Cousins.Helper.Relations, List<Path>);
view Edge2 : Edge = Edge();
view Edge3 : Edge = Edge();
view Edge4 : Edge = Edge();
enum Cousins.Gender
{
Female #1,
Male #2
};
entity Cousins.Person
= Node (),
Edge (From = this, To = Mother, Name = Name, TypeName = "Mother"),
Edge2 (From = this, To = Father, Name = Name, TypeName = "Father"),
Edge3 (From = Father, To = this, Name = Name, TypeName = "Child"),
Edge4 (From = Mother, To = this, Name = Name, TypeName = "Child")
(
Name : String
)
{
Gender : Cousins.Gender,
Mother : Cousins.Person, /* a KeyRef<Person> */
Father : Cousins.Person /* a KeyRef<Person> */
}
[
TypeName = "Person",
FatherChild : Cousins.Person (Father = this), /* a RefSet<Person> */
MotherChild : Cousins.Person (Mother = this), /* a RefSet<Person> */
@Once
Relatives = relation (this) /* a RefSet<Path> */
];
entity Cousins.Path : Edge = Edge ()
{
Edge : Edge, /* a KeyRef<Edge> */
Source : Cousins.Path, /* a KeyRef<Person */
};
RefSet<>
and KeyRef<>
are used to navigate transparently around the the SubSpace