‎09-05-2010 01:19 PM
Hello!
I am looking for some documentation with examples about Labview by Value and by Reference OO Design. Mostly, I interested in by Ref. OO Desing.
So I would be greatfuly If you could send me some useful links, examples.
Thank you!
‎09-05-2010 03:30 PM
labview is normally "by value"...what you can do if you like to pass some objects by reference, you can use single-element queues or DVR (data value references) to pass your objects around in your code...just search in labview for these terms.
‎09-05-2010 10:41 PM
You can download GOOP Development Suite, and create some classes to see the different ways of implementing this.
http://www.symbio.com/products/trial/
KEY: COMM-UNIT-YEDI-TION-2010
Here are some demos videos you can have a look at.
http://goop.endevo.net/GDS/videos/GDSFeatures
http://goop.endevo.net/GDS/videos/GettingStarted
http://goop.endevo.net/GDS/videos/GOOP4Demo
Cheers,
Mikael
‎09-06-2010 01:00 AM
Oh! Yes!!
Thanks!!!!
‎09-06-2010 02:01 AM
As a general rule, in 80 or 90% you can use the native by-val design. So don't try to make everything by-ref as in other OOP languages.
By-ref has two flavours (only using DVR, neglecting SEQ):
* Your private data is a DVR to a type def. All accessors use the IPE structure to access the data stored in the DVR.
* Put your object in the DVR.
There is a lot of discussion on these designs on LAVA, but of course nothing like a tutorial but an advanced brainstorming.
Felix
‎09-06-2010 05:43 PM
In my case the rule "As a general rule, in 80 or 90%, you can use the native by-val design" doesn’t apply.
Were I found OO serving the best purpose is in the instrument layer (HAL), there we have around 100 classes, and there I don’t want to use by value. Normally my test application uses 10-20 different driver classes and around 5 higher level classes, plus my Top application. So for me it about 60-80% that has to be reference classes. And the 5 higher level classes usually use a Singleton design pattern so then I’m close to 90% of them being reference classes.
But this is just me.
Cheers,
Mikael