Object-oriented programming in G Dataflow uses the concepts of class structure, encapsulation, and inheritance that are common in object-oriented languages, such as C++ and Java. Following object-oriented programming practices may not be necessary If you want to create a simple program with one or two VIs. However, using classes can improve the development of large and complex projects.
You can think of cars on the road as an conceptual example of classes. Despite a wide variety of car manufacturers, you can use several generic data attributes, such as the number of doors on the car and current speed at which the car is traveling, to describe every car you see. Each car also has a set of common methods that enable it to function using the data attributes that define the car. When you accelerate, brake, or use a turn signal, the car implements a method to change the state of the car.
The encapsulation of these generic data attributes and methods into a single unit defines the car class. Each car on the road is an object of the car class with a specific set of data values and methods that the car can perform on its data.
Classes are a core component of object-oriented programming, the practice of creating a program in terms of the objects on the diagram that interact and perform methods instead of the procedures the program performs itself. Creating an object-oriented program involves two parts:
Using classes to create an object-oriented program can provide the following benefits for your program.