Jump to content

Design Advice for Representing Variables in LVOOP?

Recommended Posts

I am looking for some advice on class design and design pattern. I am designing a LabVIEW library that provides access to (and encapsulates ) a COM server.

The COM interface has two variable types:

  • System Variable
  • Node Variable

Common methods:

  • Register/Unregister for Notifier
  • Register/Unregister for Event
  • Create
  • Destroy
  • Read
  • Write

Common data:

  • Name
  • Units
  • Comment

The variables differ in the refnum to the COM server and the possible data types that can be represented.

  • System Variable
    • Integer
    • String
    • FloatInteger
    • ArrayFloat
    • Array

  • Node Variable
    • Integer
    • String

I want to hide the existence of the System and Node variables from the user. They only need to know the variables that exist and the data types. I also want to restrict the user to only creating System Variables (within the COM interface).

What are your design recommendations for:

  • Where to store the "data" of the variable?
  • How to provide the user with read and write of different data types?
  • How to expose these functions to the user of this API?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.