ontology-development-kit icon indicating copy to clipboard operation
ontology-development-kit copied to clipboard

Document components design rules

Open matentzn opened this issue 3 years ago • 2 comments

  1. A component make target MUST NOT, directly or indirectly, depend on any ODK generated files/make targets, in particular not: imports, seeds, merged source files and other components.
  2. In the case you do have a logical dependency, you have to manage the dependency yourself by 1) generating the dependency with make first and 2) using the generated file in the make target of the dependent file (i.e. the component) without having an explicit make dependency.

matentzn avatar Jul 27 '22 12:07 matentzn

What's the justification for these rules?

jamesamcl avatar May 21 '23 21:05 jamesamcl

@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.

gouttegd avatar May 21 '23 22:05 gouttegd