OK, you've gotten through all the basics of
package building and your ready for the advanced stuff. Now,
let's learn about package dependencies.
First, what is a dependency? Basically, its something you need -- a
Package Dependency is something your package needs. Here's a simple example:
When a package ("Package A") uses subVIs that are part of another
package ("Package B"), we say that Package B is a dependency of Package
A.
We can manage the dependencies of the package we're building in the
Dependencies page of
Advanced Build Parameters dialog:
1) Open
the
Package Builder window and select the “Test Package Source” folder as your
VI Package Source Folder. (Note that you obtained
Test Package Source.zip in the
Building your
First Package exercise)
2) Open the
Advanced Build Parameters dialog from the
VI Package Builder window by pressing the
Advanced Build Parameters button on the toolbar.
3) Click on the
Dependencies item in the tree, to open the
Dependencies page.
4) To discover what our package's dependencies are, we need to press the
Scan for Package Dependencies button, as shown below:
This will cause VIPM to scan all the VIs in your VI Package Source
Folder to discover which packages your VIs are using (by calling subVI
from those packages).
5) Once, the scanning process is complete, you will see a list of all the
package dependencies that were discovered. Press the
OK button to confirm the dependencies.
You will be returned to the Dependencies page of the Advanced Build
Parameters dialog and you will see that the discovered package appear
in the list of dependencies.
Now, here's where it gets a little bit tricky (but, that's OK because you're a package building junkie, right?).
You will notice that there are two kinds of dependencies:
Internal Dependency
External Dependency
Let's look at what these mean, exactly.
Earlier, we said that when a package ("Package A") uses subVIs that are part of another
package ("Package B"), we say that Package B is a dependency of Package
A.
Now, the developer/author of Package A might want to choose to have the
subVIs from Package B that are being used by Package A built into
Package A so that users of Package A do not need to have Package B
installed in order to use Package A. In this scenario, we call
Package B an
Internal Dependency (

) of Package A.
However, if the developer/author of Package A doesn't want
the subVIs from Package B built into
Package A, then users of Package A must have Package B installed in
order to use Package A. In this scenario, we call Package
B an
External Dependency (

) of Package A.
By default, packages are added as
Internal Dependencies (

).
This is the fail-safe behavior, as it means that end users do not
need to know or care about the dependency in order to user your package
-- everything that your package needs is built into your package.
However, there are some benefits of choosing
External Dependency (

)
:
- Your package file will be smaller
- If improvements are made to the dependency, you do not have to
rebuild and re-release your package in order for your users to receive
the benefits of the improvements -- they can simply upgrade the
dependency.
As the package developer the choice is yours.
6) You can toggle each dependency between
Internal and
External by clicking on it's glyph. Give it a try.
7) You should note that
Internal Dependencies always have an exact package version, and that
External Dependencies have a range of package versions (with >= as the default comparison).
8) Double-click one of the packages in the list to open the detailed
package depenency editor. Here you can edit the version number
and the comparison, as well as choose between between
Internal and
External.
Now, let's look at another, related feature:
Package Configuration Management.
Up:
VI Package Guide
If you have any feedback or questions (including ideas for other topics
you'd like to learn more about), please consider posting them to the VIPM Discussion Forums. We're looking forward to your feedback.