Packed Project Library Exported Class Methods?
#1
Posted 17 April 2012 - 08:19 PM
Note: Some of these are dynamic dispatch which cannot be set to Community or Private in the class.
Brian
Certified LabVIEW Architect (CLA)
Certified TestStand Developer (CTD)
#2
Posted 18 April 2012 - 09:16 AM
There is a valid use case for creating a wrapper class that has a reduced set of methods that wraps an inner class. This is done a lot in various programming languages to create a read-only version of the class, so the wrapper class only has methods for reading values, not writing them. You would then hide the core class inside the packed project library (making it private to the library) and expose your wrapper class only.
#3
Posted 18 April 2012 - 02:25 PM
Hence the reason for my post. Dynamic dispatch VIs seem like a catch 22 with lvlib scope. You are forced to wrap the class to hide just a single VI.To control what is visible, set the access scope. The dynamic dispatch VIs can be set to protected, which is the only other meaningful scope for dyn disp -- it doesn't make sense to have a dynamic dispatch method that cannot be overridden by children.
For large projects, this seems like a lot of work to hide one or two dynamic dispatch VIs. It would be nice to control what VIs are visible/exported in the lvlib properties.There is a valid use case for creating a wrapper class that has a reduced set of methods that wraps an inner class. This is done a lot in various programming languages to create a read-only version of the class, so the wrapper class only has methods for reading values, not writing them. You would then hide the core class inside the packed project library (making it private to the library) and expose your wrapper class only.
Any thoughts? I may put this into the idea exchange...
Brian
Certified LabVIEW Architect (CLA)
Certified TestStand Developer (CTD)
#4
Posted 19 April 2012 - 01:32 PM
Why isn't protected scope sufficient hiding?Hence the reason for my post. Dynamic dispatch VIs seem like a catch 22 with lvlib scope. You are forced to wrap the class to hide just a single VI.
That would be unusual among the world's OO languages. I'm not saying it's a bad idea, but when none of the major OO languages that I know of do it, I always have to ask why. Scope is not one of those areas that is impacted by dataflow.For large projects, this seems like a lot of work to hide one or two dynamic dispatch VIs. It would be nice to control what VIs are visible/exported in the lvlib properties. Any thoughts? I may put this into the idea exchange...
#5
Posted 19 April 2012 - 02:15 PM
Because the VIs are still visible in the Packed Project Library (they are not hidden):Why isn't protected scope sufficient hiding?
Since they shouldn't be used, the user will question why they are visible.
Isn't this a feature of the Packed Project library (that does not exist in other languages)? The PPL is used for "interface" and it would be nice to separate the "presentation" from the class itself. This would reduce a whole lot of "busy work" wrapping classes.That would be unusual among the world's OO languages. I'm not saying it's a bad idea, but when none of the major OO languages that I know of do it, I always have to ask why. Scope is not one of those areas that is impacted by dataflow.
Thanks,
Brian
Brian
Certified LabVIEW Architect (CLA)
Certified TestStand Developer (CTD)
#6
Posted 19 April 2012 - 04:34 PM
To me a better approach would be to just support private inheritance.There is a valid use case for creating a wrapper class that has a reduced set of methods that wraps an inner class. This is done a lot in various programming languages to create a read-only version of the class, so the wrapper class only has methods for reading values, not writing them. You would then hide the core class inside the packed project library (making it private to the library) and expose your wrapper class only.
/ducks
#7
Posted 20 April 2012 - 05:20 AM
PPLs are not a part of the LabVIEW language. They're just packaging for functionality, no different in many ways to a .zip file. The PPL is not a presentation layer or any other formal aspect. It's just a tool for getting VIs to load faster.Isn't this a feature of the Packed Project library (that does not exist in other languages)? The PPL is used for "interface" and it would be nice to separate the "presentation" from the class itself. This would reduce a whole lot of "busy work" wrapping classes.
When you ask for changes to scope, that addresses language features, which means changes to the run time behaviors that would impact dev environment and run time environment alike, regardless of packaging.
A good write up of why composition is preferred to private inheritance:To me a better approach would be to just support private inheritance.
http://www.parashift...nheritance.html
#8
Posted 23 April 2012 - 03:54 PM
It sounds like this would be a major addition (or would never happen), but it would be nice if the lvlib supported a presentation layerPPLs are not a part of the LabVIEW language. They're just packaging for functionality, no different in many ways to a .zip file. The PPL is not a presentation layer or any other formal aspect. It's just a tool for getting VIs to load faster. When you ask for changes to scope, that addresses language features, which means changes to the run time behaviors that would impact dev environment and run time environment alike, regardless of packaging.
Brian
Certified LabVIEW Architect (CLA)
Certified TestStand Developer (CTD)











