Because a Webel ADT is stateless, ADTs that wrap other large ADTs can quickly become unwieldy, noting that a Webel ADT does not (yet) use "pointer-like" references.
For example, in the Webel OpenXML libraries for creating structured data from unstructured spreadsheet data, a US$Cell needs an XL$ResourcesMap (which contains a lot of spreadsheet bundle information), so wrapping an XL$ResourcesMap in each US$Cell would make each US$Cell large (and difficult to view in Notebooks during development). So instead, each US$Cell just carries the ID of an XL$ResourcesMap and looks it up as needed (optionally with efficient UUID-driven Once-caching), as shown in these slides:
The adt$store[adt]
and adt$fetch[id]
functions enable an ADT to use lookup against the id
of a Webel ADT, so the ID is used a bit like a pointer. In the Webel SysML4Mathematica (v1) modelling a property that is resolved by adt$fetch[id]
lookup is denoted «adt:ref» - with a tagged value 'id' which is the name of the corresponding wrapped ID property of the ADT (typically the 2nd argument after the special '$$' primary).
A Webel ADT currently uses Hash
to create Integer IDs. Chances of ID clashes are very small (especially if the ADT store only has a few large ADTs), but ID clashes are possible, so this ID strategy may be revised. Tests show that Hash is faster than using CreateUUID Strings.
Compare with MTools, where each object gets a Unique identifier and there is a behind the scenes lookup. In this example, the newAll
function is used to create a Webel MAll MTools extension object:
newAll[]
MAll[object$3931820]