1
Vote

Fact manifest

description

To solve the two problems of versioning and integration, compile multiple fact files via a fact manifest.

The manifest is a file named Model.fman. If this file is present, it takes precedence over Model.fact. The manifest lists fact files to merge. Files are listed in reverse chronological order. An optional alias is applied to each. For example:

Model.fact
Model.v2.fact alias MyApp.Model.V2
Model.v1.fact alias MyApp.Model.V1
TheirModel.fact

A fact's version is determined by its key section. If the same fact version appears in more than one file, then the class is generated in the namespace alias of the earliest occurrence. The mutable and query sections are merged. If different definitions are given for mutables or queries with the same name, the compiler raises an error.

If different versions of a fact appear in different files, then different classes are produced, one in each alias namespace. The developer must use the non-generic version of the query result to access a set that includes different versions of the fact.

If a fact is expressed without a key, then it is merged with the next occurrence of that name in another file.

Imports can appear at the top of a fact file to import facts from another namespace. For example:

namespace MyApp.Model
import TheirApp.Model
{
TheirIndividual = Individual
}

All facts are compiled into a single CorrespondenceModel.

comments