User Tools

Site Tools


kb:bestpractices:codingconventions:lvoop

Table of Contents

06 LVOOP

General

  • Make a class as private as possible - only expose the methods needed
  • Documentation: remove the .lvclass from the name in the Properties dialog
  • Use the “descendents must override” option in the Item settings of the class Properties dialog if methods have to be implemented in the child classes

Naming

  • If a class is only created for the purpose of serving as the parent for multiple child implementations, add the word abstract to the class name
  • Object Lifetime
    • instantiating an object: Create
    • destroying an object: Destroy
  • Accessors (Property nodes for setting or getting a single property of a class (*))
    • “Get” (not “Read”)
    • “Set” (not “Write”)

Folder Structure

  • structure on disk is usually flat (not subfolders)
  • maintain accessors in virtual subfolder
  • VIs with special access scope (eg private) in a separate virtual subfolder

(*) Beware performance overhead in the microsecond range. See https://dokuwiki.hampel-soft.com/kb/ni-rt/performance


kb/bestpractices/codingconventions/lvoop.txt · Last modified: 2024/12/10 17:45 by joerg.hampel