Object-oriented programming: Difference between revisions
Added G Interfaces Section |
Restructure and rewrite the article |
||
Line 1: | Line 1: | ||
Object oriented | '''Object-Oriented Programming''' (OOP) is a [[Wikipedia:programming paradigm|programming paradigm]] that enforces [[Wikipedia:object-oriented design|object-oriented design]] principles to solve software problems. As of [[LabVIEW 8.20]], LabVIEW is an object-oriented programming language. In object-oriented programming, a [[class]] defines data with restricted access, and [[method]]s to work with that data. A client then creates an [[object]] - a specific instance of a class - to perform actions using methods that are exposed by the class. The implementation details are hidden from the client. | ||
Because implementation details are hidden from the client, methods and data of a class can change without affecting any of the client's code. This can even happen at runtime by replacing one class with another of the same kind. Classes can [[inheritance|inherit]] methods and data from a parent class to [[overriding|override]] methods of the parent class. The client can then use the child class as if it was the parent class, without changing any of the existing code. Methods called by the client will seamlessly execute the methods defined by the child class. If the child class doesn't override a method, the parent's method is called. This behavior is called [[dynamic dispatching]] in LabVIEW. | |||
A parent class can change the [[access scope]] of a method to limit access to child classes (protected), friends (community) or nobody (private). Public methods are accessible by anyone. | |||
== | ==Benefits of OOP== | ||
===Reusability=== | |||
===Scalability=== | |||
== | |||
== | |||
== | |||
==See also== | |||
* [[LVClass]] | * [[LVClass]] | ||
* [[G-sharp Framework]] | * [[G-sharp Framework]] | ||
* [[GOOP]] | * [[GOOP]] | ||
* [[Americas CLA Summit 2019#StephenGInterfaces|Stephen Loftus-Mercer ACLA Summit 2019 Presentation on G Interfaces]] | |||
== External | ==External links== | ||
*[http://www.ni.com/white-paper/3573/en/ NI FAQ on Object Oriented Programming] | * [[Wikipedia:Object-oriented design|Object-oriented design]] (Wikipedia) | ||
* [[Wikipedia:SOLID|SOLID]] (Wikipedia) | |||
*[http://www.ni.com/white-paper/3573/en/ NI FAQ on Object Oriented Programming] | |||
*[https://forums.ni.com/t5/LabVIEW-Development-Best/Introduction-to-Object-Oriented-Programming-and-Hardware/ta-p/3519580 Introduction to Object Oriented Programming] by Elijah Kerry | *[https://forums.ni.com/t5/LabVIEW-Development-Best/Introduction-to-Object-Oriented-Programming-and-Hardware/ta-p/3519580 Introduction to Object Oriented Programming] by Elijah Kerry | ||
*[http://zone.ni.com/reference/en-XX/help/371361P-01/lvconcepts/creating_classes/ Creating Classes] | *[http://zone.ni.com/reference/en-XX/help/371361P-01/lvconcepts/creating_classes/ Creating Classes] | ||
*[https://forums.ni.com/t5/LabVIEW-Development-Best/When-Should-You-Use-LabVIEW-Classes/ba-p/3478257 When should you use classes] | *[https://forums.ni.com/t5/LabVIEW-Development-Best/When-Should-You-Use-LabVIEW-Classes/ba-p/3478257 When should you use classes] | ||
{{stub}} | |||
[[Category:Object-Oriented Programming]] | |||
[[Category:Programming Paradigm]] |
Revision as of 17:07, 31 March 2020
Object-Oriented Programming (OOP) is a programming paradigm that enforces object-oriented design principles to solve software problems. As of LabVIEW 8.20, LabVIEW is an object-oriented programming language. In object-oriented programming, a class defines data with restricted access, and methods to work with that data. A client then creates an object - a specific instance of a class - to perform actions using methods that are exposed by the class. The implementation details are hidden from the client.
Because implementation details are hidden from the client, methods and data of a class can change without affecting any of the client's code. This can even happen at runtime by replacing one class with another of the same kind. Classes can inherit methods and data from a parent class to override methods of the parent class. The client can then use the child class as if it was the parent class, without changing any of the existing code. Methods called by the client will seamlessly execute the methods defined by the child class. If the child class doesn't override a method, the parent's method is called. This behavior is called dynamic dispatching in LabVIEW.
A parent class can change the access scope of a method to limit access to child classes (protected), friends (community) or nobody (private). Public methods are accessible by anyone.
Benefits of OOP
Reusability
Scalability
See also
External links
- Object-oriented design (Wikipedia)
- SOLID (Wikipedia)
- NI FAQ on Object Oriented Programming
- Introduction to Object Oriented Programming by Elijah Kerry
- Creating Classes
- When should you use classes
This article is a stub. You can help LabVIEW Wiki by expanding it. Please improve this article if you can. |