ontology-development-kit
ontology-development-kit copied to clipboard
Document components design rules
- A component
maketarget MUST NOT, directly or indirectly, depend on any ODK generated files/make targets, in particular not: imports, seeds, merged source files and other components. - In the case you do have a logical dependency, you have to manage the dependency yourself by 1) generating the dependency with
makefirst and 2) using the generated file in themaketarget of the dependent file (i.e. the component) without having an explicitmakedependency.
What's the justification for these rules?
@udp: Avoiding circular dependencies.
For example, generating the import modules requires, among other steps, extracting the “seed” file. That extraction in turn requires both the -edit file and all the declared components.
If a component was dependent on an import module, you would end up in a situation where you would need to generate the imports before you can make the component, but you would need the component before you can generate the imports.
Forbidding custom components from depending on other Make targets allows us to assume that such a conundrum cannot happen.