Jump to content

Design patterns for data storage


Recommended Posts

Hello all!

First post.

I wrote a long nice message and then IE crached. :throwpc:

Im looking for design patterns for encapsulation and protection of data. Very much like an object with private data (but not a singleton). I would like to accomplish this by not using LVOOP. Data/object should be referenced by a refnum (I imagine). Guess there is a default solution to this that I dont know of.

All ideas welcome!

Link to comment

As mentioned, dqGOOP works very well and there are other by-ref GOOP toolkits around (e.g. Endevo GOOP, Sciware GOOP), but you can also have by-ref wrappers for LVOOP, and there's even a shipping examples. Additionally, if you search the forums, you should find a link Aristos Queue posted to a list of design patterns implentations in LVOOP.

Link to comment

Sorry for my late reply. Vacation...

normandinf: There is some "political" resistance within my organization against OOP in general, caused by improper use in previous projects. I'm also impressed by those *OOP-packages that allowes access to data using ref's and would like to know if there is an easily reuseable method behind it.

By experience I guess that the newly introduced (lv8.2) OOP-constructs are not that reliable (I am unfortenately stuck with lv8.2) until a few versions later.

Link to comment

QUOTE (Jon Sjöstedt @ Aug 8 2008, 04:30 PM)

normandinf: There is some "political" resistance within my organization against OOP in general, caused by improper use in previous projects.

There are never any guarantees in software, but you should try to diagnose the situation to see what went wrong and what can be done about it (e.g. maybe OOP wasn't appropriate, maybe it was implemented by people who didn't understand the concepts, maybe it wasn't designed well enough)

QUOTE

I'm also impressed by those *OOP-packages that allowes access to data using ref's and would like to know if there is an easily reuseable method behind it.

These tools usually have a template and a wizard which copies that template, so that much is reusable, but you usually don't need to know about it, because the wizard does all the work. If you're asking about whether you can have inheritance or write code for one class and reuse it, that highly depends on which implementation you use and how you write your code. Some of these are free (like dqGOOP), so you can just download it and see.

QUOTE

By experience I guess that the newly introduced (lv8.2) OOP-constructs are not that reliable (I am unfortenately stuck with lv8.2) until a few versions later.

I don't know any specific details, but there were certainly issues with LVOOP in 8.2 which were resolved in later versions. You can see details by looking through this board and looking at NI's known issues documents.

Link to comment

Guess this was unclear

QUOTE

I'm also impressed by those *OOP-packages that allowes access to data using ref's and would like to know if there is an easily reuseable method behind it.

Clarification attempt: I am not looking for OOP design elements in general. I am specifically interested in a way to access data in pointer-style (=refnum?). Dataprotection is desireable if possible. I have noted the very elegant LV2-style singleton design (which uses no magic *OOP-package or LVOOP) and need to complete it with a non-singleton datastorage. Hope this was more clarifying than confusing... :)

I will look into dqGOOP and see if that gets me where i want. Thanks for all help so far!

Link to comment

QUOTE (Jon Sjöstedt @ Aug 11 2008, 04:01 AM)

Shameless Plug: You may also want to look at the Current Value Table implementation, available on ni.com.

Current Value Table (CVT) Component

A Current Value Table for LabVIEW

It uses the FGV design to implement data storage for any number of tags or values in your application. The data or values are accessed by name or by index (refnum), your choice. In the current design you must initialize the CVT at the beginning of your application with the list of variables you will be using. This list is passed as an array of clusters to the Init VI and can be created dynamically, defined statically (constant), or read from a file. The current implementation includes support for scalar Boolean, Doubles, I32, Strings, and Enums. It can be easily extended to other data types. Arrays are a bit more tricky and are not included in the published code. I do have a trial implementation for arrays that I can send you or post on request.

Please provide any feedback or suggestions for the CVT in the provided discussion forum. General questions I can answer here.

Link to comment

QUOTE (Jon Sjöstedt @ Aug 11 2008, 12:01 PM)

http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=305242#M305242' target="_blank">This example is implemented using dqGOOP. You also have VIs there which you can download to see how it works.

Pumps%20Example_GOOP1.png

P.S. Christian, nice work on the CVT and the components in general. I think creating tools like this is very useful. Any reason why these components don't ship as standard in vi.lib?

Link to comment

QUOTE (Yair @ Aug 11 2008, 12:58 PM)

Thank you. These are not included in the standard product for several reason. The quick reasons are documentation, testing, maintenance, support, forward compatibility, etc. It takes a lot more time and effort to add a feature or set of VIs into LabVIEW and maintain them long term than my group can provide. We are not part of R&D and don't pretend to develop products. Our goal is to share with the wider LabVIEW community things we learn and code we develop while working with customers and integrators on individual applications. In short we have the same motivation as the LAVA community; to improve the experience of LabVIEW users by sharing what we know and do.

In addition we like to use what we publish on DevZone as a trial run and sounding board for possible new features and VIs to be added to LabVIEW and other products in the future. By not including the VIs in LabVIEW right away we're not committing to a particular functionality or API until we feel it is ready for the product. Some of the code we have developed has made it into examples shipped with LabVIEW. Specifically the LabVIEW Touchpanel module 8.6 includes a reference design based on code we published last year. However, in general what we do and the feedbapck we provide to R&D makes its way into the product in other more hidden ways, e.g. by improving current features or adding new features that may look different from the original solution we provide. For example, the cRIO I/O Engine (CIE) we published last year has just been surplanted by the Scan Engine and RIO Scan Interface released in version 8.6. This effectively negates the need for one of the reference designs we published last year, which is exactly what my group likes to see.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.