TomOrr0W Posted July 25, 2012 Report Share Posted July 25, 2012 Does anyone have a method for preventing a class from being inherited by other classes in LVOOP? This question came up while researching Object-Oriented API Design guidelines, one I came across in text-based languages was "Design and Document for Inheritance or Else Prohibit it" (see Slide 26 of http://lcsd05.cs.tam...des/keynote.pdf; there is also a video of the presentation on YouTube). In the case of classes that are reused within a team or publicly distributed, the issues discussed there with changing implementation details in the class being distributed potentially breaking children seems to still be valid in LabVIEW. Quote Link to comment
Tim_S Posted July 25, 2012 Report Share Posted July 25, 2012 You can inherit a class if you can see it, so I don't think there is a way to expose a class and not make it inheritable. The next best thing would be to make data and VIs private. Is this a concern, though? The person creating the child class either has access to the source code, or is accessing a distribution of some kind (source distribution or packed library). The first case is moot as the person can change the source to be whatever they want. The second case is one where the original developer has chosen what to expose though design. Quote Link to comment
Aristos Queue Posted July 26, 2012 Report Share Posted July 26, 2012 We have never introduced any sort of "sealed" concept into LabVIEW. If you do not wish to have to design for inheritance, then you avoid having any dynamic dispatch methods or any protected scope methods. I'd like to someday add "sealed", but it's not been a priority. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.