-
Notifications
You must be signed in to change notification settings - Fork 1
Programming Model: Data Addressing
Table of Contents // Back: Data Modelling // Continue: Data Storage & Access
See also: ONMjs.Address (address class reference)
See also: ONMjs.AddressToken (address token class reference)
See also: ONMjs.address.* (address function reference)
ONMjs addresses are most easily understood by analogy:
Consider that you're an architect charged with creating the design for a new apartment complex comprising many buildings that are all identical save for the fact that they're not to be built in exactly the same location. Within each building are a number of different apartment configurations: some are large, others small. Some have a fireplace and walk-in closets, while others have fewer amenities.
In drawing up the design plans to be given to the construction crew, it's necessary to specify directions for each apartment. However, you don't need to duplicate this effort for each building to be constructed because all the buildings are identical. So you draw up a single generic design plan that omits the building numbers and address each apartment using a simple scheme that identifies each by its floor and unit number.
Relating this back to ONMjs:
An ONMjs data model is like your generic design plan for an apartment building.
An ONMjs object store is like a specific apartment building.
An ONMjs address is like the floor/unit number of an apartment.
And finally, actual run-time data is like the actual contents of a specific apartment in a specific apartment building once its built and someone has moved in.
The term "address space" is a just a fancy way of talking about the set of all possible addresses. In our apartment building analogy, the "address space" is the set containing all apartment units within a specific building as specified in the building's design plan. Similarly, an ONMjs address space is the set of all possible namespace addresses specified by your declared data model.
The salient point here is that an "address space" is something that's defined at design-time. Specifically, an ONMjs address space is defined when you declare your data model declaration. We'll use this term subsequently as shorthand for discussing the set of legal addresses.
Note that unlike the "address space" of an apartment building, ONMjs address spaces may be, and typically are, infinite sets due to the common use extension point/component namespaces, and less frequently recursively-declared namespace hierarchies.
We'll start with the simple cases where our apartment building analogy holds, and progress to the more complicated cases where the analogy breaks down.
Fundamentally, an ONMjs.Store class instance manages a single Javascript object on behalf of your application. As discussed in the [Data Modeling
Table of Contents // Back: Data Modelling // Continue: Data Storage & Access
Copyright (C) 2013 Christopher D. Russell