Dependent destinations

Most of the Destinations in the Model depend on another Destination as conceptually, the Model is “about” an entity, and all the information related to it.

For example, when importing data about a person, as well as the information about the person, you might have information about their projects, publications, deadlines, etc.

In the Haplo database and object store, dependent Destinations have some reference to the Destinations that they depend on, and these links are managed automatically:

  • Attributes which link objects together are set automatically for new objects
  • Creation and loading of existing dependent destinations is implicit, without needing to use the load Instruction.

In general, you should load the main Destination (such as the profile Destination for models about people and their information), and then just refer to other Destinations. The data import framework will manage loading and creation.

If you are creating multiple dependent objects, for example, multiple books written by an author, then use the new Instruction to create new objects.

Checking expectations

While in general everything will just work, the downside of automatic load or creation of dependent destinations is that batch import operations may not do what you want if data isn’t in the state you expect.

To prevent errors, use the assert-destination Instruction to check the state of the existing data, and ignore the Record if it’s wrong.