Access Scope
When you give VIs to others to use, they generally fall into two categories: the VIs that they're supposed to call as subVIs (called interfaces), and supporting VIs that they're not supposed to call directly (which are subVIs of the interface VIs).
Pre-LabVIEW 8.0, you had no way to enforce that they didn't call your support VIs. When creating a new version of your VIs, you couldn't be sure whether or not you would break other people's VIs if you changed your support VIs.
In LabVIEW 8.0, we introduced the project library, which (in addition to namespacing) gives you the ability to set private access scope. Access scope lets you distinguish between your (public) interface VIs and your (private) support VIs.
If you're not yet familiar with project libraries (which we usually call simply libraries), let me clear up a common misconception. Libraries are not LLBs. LLBs are containers, where a single file on disk contains multiple VIs. Libraries are separate files on disk from their member items.
You can think of libraries like exclusive clubs. A VI can be a member of one and only one. Being a member gives the VI certain privileges, including the ability to call private VIs in the library.
In LabVIEW 8.20, we introduced LabVIEW Classes, which also have public and private access scope. (Classes are, in fact, a type of library). Classes, however, have an additional access scope called protected.
We used that name because it's used in other object-oriented languages and we couldn't come up with a better one. It is not, in my opinion, a good name. The obvious question is, "Protected from what?" So let me try to explain.
VIs that have protected access scope can be called by VIs in the same class or descendent classes. (That means classes that inherit from the class directly or indirectly).
There are cases in object-oriented design where you simply need this ability. For example, suppose you have a public interface VI for your class, and a support VI that it requires. What should the access scope of the support VI be? At this point, probably private.
But if you then make the interface VI dynamic so that child classes can override it, things change. If you want those override VIs to be able to call the support VI in the parent class, you can't have it be private. But you don't want VIs outside the classes to call it. So you make it protected.
Pre-LabVIEW 8.0, you had no way to enforce that they didn't call your support VIs. When creating a new version of your VIs, you couldn't be sure whether or not you would break other people's VIs if you changed your support VIs.
In LabVIEW 8.0, we introduced the project library, which (in addition to namespacing) gives you the ability to set private access scope. Access scope lets you distinguish between your (public) interface VIs and your (private) support VIs.
If you're not yet familiar with project libraries (which we usually call simply libraries), let me clear up a common misconception. Libraries are not LLBs. LLBs are containers, where a single file on disk contains multiple VIs. Libraries are separate files on disk from their member items.
You can think of libraries like exclusive clubs. A VI can be a member of one and only one. Being a member gives the VI certain privileges, including the ability to call private VIs in the library.
In LabVIEW 8.20, we introduced LabVIEW Classes, which also have public and private access scope. (Classes are, in fact, a type of library). Classes, however, have an additional access scope called protected.
We used that name because it's used in other object-oriented languages and we couldn't come up with a better one. It is not, in my opinion, a good name. The obvious question is, "Protected from what?" So let me try to explain.
VIs that have protected access scope can be called by VIs in the same class or descendent classes. (That means classes that inherit from the class directly or indirectly).
There are cases in object-oriented design where you simply need this ability. For example, suppose you have a public interface VI for your class, and a support VI that it requires. What should the access scope of the support VI be? At this point, probably private.
But if you then make the interface VI dynamic so that child classes can override it, things change. If you want those override VIs to be able to call the support VI in the parent class, you can't have it be private. But you don't want VIs outside the classes to call it. So you make it protected.
Labels: labvoop