The store contains information about one or more models. A store can contain a collection of models, although often there is only one model in the store.
The store also contains metadata about a model and information about the instances of the elements and links between elements that make up that model. Metadata contains the types allowed in the model and their relationships.
The store has several data structures that are filled when a model is loaded into the store. This occurs under the following circumstances:
when your domain-specific language is launched, either as an experimental build
when you have deployed your domain-specific language and an end user launches it
when you load a model programmatically into the store
The DomainDataDirectory contains the metadata about the types allowed to be in the model.
The ElementDirectory contains information about each element instance and their links. (The instances in the ElementDirectory must be of types defined in the DomainDataDirectory.)
From the store, you can navigate to the individual items in the store. You can get information about elements or types. You can also do the following tasks:
Whenever you modify a store, you must enclose any code that writes to the store in a Transaction. You can cancel all the changes to the store made in a transaction by doing a Rollback of the transaction or by not doing a Commit of the transaction.
The store has a RuleManager that contains functionality to subscribe to rules. The store can also subscribe to events.
The store also has an UndoManager which has members that allow you to undo and redo changes to the store. You generally do not have to create a new instance of a store, although you can and can read a model into it by deserializing a model into the new instance. Often, you get access to the store from the Store property of an element or link in the model. The event arguments of rules and events provide the element or link instance that the rule or event pertains to, and you can use its Store property to access the store and its TransactionManager.