From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
milaus

Abstract methods in classes

Status: Declined
Already implemented in LabVIEW. Available in LabVIEW 2009.

Classes in LabVIEW are a great step over (and finally, with LV 2009 them start to work...) but there are still two 'holes'

 

Abstract methods. 

It would be great to have the possibility to define abstract methods and interfaces. Now I'm forcing an error into the error out indicator to notify the usage of a method not yet defined but it would be better to make the compiler to recognize the usage of abstract methods during the design time. One way to define abstract methods could be the introduction of a new entry in the 'class menu' and allowing to define them just in term of front panel (block diagram not available).

 

Class duplication.

An object is duplicated on each node, so is not easy to work into parralel loops on the same instance. To use the same instance I have used references, but it is not so easy to use (not as the 'normal' wires) and it hasn't the same performance (working with reference is heavier than working with instances). It would be great to introduce a mechanism that implements the convertion from instance to object, something likes a standard 'getReference' and 'getInstance'.

4 Comments
AristosQueue (NI)
NI Employee (retired)

This idea is already implemented in LV 2009. 

 

The "Must Override" flag in LV 2009 is our solution to the abstract methods problem. Marking this in the Class Properties dialog on a given dynamic dispatch VI causes all directly derived classes to be broken unless they override the method or pass the requirement along to their own children. True abstract methods would make it impossible to execute any VI that had the parent class as part of its conpane, which would violate one of the prime debugging powers of LabVIEW, which is that any VI can be run and tested directly. The block diagram of an abstract method still has value as it serves as a place to put Call Parent behavior -- exactly like the "pure virtual with implementation" behavior of C++.

Todd S.
NI Employee (retired)
Status changed to: Completed
Implemented previously in LabVIEW 2009.
Todd S.
LabVIEW Community Manager
National Instruments
G-Money
NI Employee (retired)
Status changed to: Completed
Available in NI LabVIEW 2009
G-Money
NI Employee (retired)
Status changed to: Declined
Already implemented in LabVIEW. Available in LabVIEW 2009.