- Rules for Extension Dependencies
- Rules for Package Dependencies
- Resolving Packages
- Illegal Package Uses
- Summary
Rules for Extension Dependencies
Extension dependencies are specified in your ExtensionInfo when you build your Extension. They are completely manual, and you can specify them how you like. The only rule to consider is to not cause any circular dependencies.
To explain what a circular dependency is, let's use an example. If we have the Extensions A, B and C, we can specify that A depends on B, and that B depends on C. Once that is the case, we cannot also specify that C should depend on A, because that causes a circularity. Similarly, A and B cannot depend on each other at the same time.
The reason why we are not allowed to have circular dependencies is simply that they prevent the Extensions from being built. Given that A depends on B, then to build A, we must first build B. However, if B also depends on A, then we must first build A. At this point, we are unable to build either Extensions because both of them require another Extension that has yet to be built (and cannot be built!).
Rules for Package Dependencies
All Extensions consist of one or more packages. The package dependencies cannot be directly specified; they are automatic and are based on who is using what.
For example, say we have a package in the CET Abstract Office Extension. This package requires the CET Core Extension (package cm.core), and so has the following line in its package.cm file:
use cm.core;
This will generate the package dependency where CET Abstract Office is depending on CET Core.
Resolving Packages
If we look at our two most basic Extensions, we have CET Core and CET 3D. CET Core depends on CET 3D, while CET 3D does not depend on any other Extension at all. Now focusing on CET Core, we have three different kinds of packages:
- Contained packages (packages in CET Core)
- External packages (packages in Extensions that CET Core depends on)
- Fundamental packages (packages in CET Runtime)
All packages in CET Core have to be resolvable from either contained, external or fundamental packages. Examples:
- Contained: cm.core.dwg is using cm.core, both packages are in CET Core
- External: cm.core is using cm.core3D in the CET 3D Extension
- Fundamental: cm.core is using cm.io which is a fundamental package
Illegal Package Uses
Fundamental packages may only use other fundamental packages, they may never use Extension packages. For example cm.io cannot use cm.core!
Extension packages cannot use packages in Extensions that they are depending on (as specified by the Extension Dependencies). For example cm.core cannot use cm.abstract.office!
Summary
In short, the rules are:
- Extensions cannot have circular dependencies.
- Packages may only have circular dependencies within the Extension.
Comments
0 comments
Please sign in to leave a comment.