Introduction to Object-Oriented Programming


If you have programmed in other languages, you have probably heard of (and maybe have used) object-oriented programming (OOP) techniques in some of your previous applications.

This appendix assumes you are somewhat familiar with concepts of object-oriented programming, and that you have mastered the basics of LabVIEW. If not, much of the material here will probably confuse you. Don't feel badOOP is a very big and advanced topic. Learn about OOP and learn LabVIEW, though, and you will have some very good programming skills to work with.


OOP is a (really) big subject, and there are a lot of good resources for learning OOP. We encourage you to spend some time learning about OOP, in order to better understand LabVIEW object-oriented programming techniques. You can find a lot of good references simply by googling "object-oriented programming."

Object-Oriented Programming Concepts

The following concepts are central to OOP:

  • Class The definition of the data type and behavior of objects.

  • Object An instance of a class.

  • Encapsulation The ability of objects to hide specific details of how they implement their behavior.

  • Inheritance The ability of classes to specialize another class (without having to modify the class that is being specialized).

  • Abstraction The ignoring of specific characteristics of objects that are not important to the work at hand.

  • Polymorphism The ability of different classes to each implement a behavior in their own way. The definition of how a behavior is implemented is defined inside the class.

Programming languages that support all of these concepts, in the editor and compiler, are referred to as object-oriented languages. Many programming languages support some of these concepts, including LabVIEW. And, LabVIEW continues to become more of an object-oriented language, even as this book is being written.

The objective (no pun intended) of OOP is to design systems that can evolve with as little (human) effort as possible. OOP strives to minimize the amount of work required to make incremental changes and improvements to the system. This is generally achieved through loose couplingavoiding unnecessary dependencies that prevent software components from being modular, maintainable, and reusable.

One word of caution about object-oriented programmingit's not the best tool for every problem. Do use OOP to implement an object-oriented model of your system. Don't use OOP to solve every programming task.


Object-Oriented Analysis and Design

Before we discuss more about LabVIEW OOP, it is important to discuss object-oriented analysis (OOA) and object-oriented design (OOD). OOP is simply a tool that allows you to implement models that are developed using object-oriented design techniques. Without a good design, OOP is no better than any programming tool applied to a poorly designed system. And, models should be designed such that they reflect real-world systems (because we are trying to automate the real world). The process of analyzing real-world systems in order to create object-oriented designs is referred to as object-oriented analysis. There are some very good (and standardized) methodologies and techniques for doing object-oriented analysis and design. Again, you can find some of these by googling "object-oriented analysis" and "object-oriented design."




LabVIEW for Everyone. Graphical Programming Made Easy and Fun
LabVIEW for Everyone: Graphical Programming Made Easy and Fun (3rd Edition)
ISBN: 0131856723
EAN: 2147483647
Year: 2006
Pages: 294

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net