LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 07/19/2010


@Intaris wrote:

@Ben wrote:

 

My wife left me home alone with a case of beer...... There is nothing like total imersion to get new stuff into my head.

 

Ben


Lemme guess.

You took a bath in the beer? Smiley Very Happy


Even in the interest of furthering my LV knowlege, that would be a waste of good beer. But to stay on topic...

 

You would never run into that issue in LVOOP since the Composition Pattern would tell us that all of the instance of class Beer are appended to an array in the Class MyStomach.

 

The situation you described would be something like the Classes BathToys, Ben, and Beer all inherit from class "StuffInTub" which is an array inside the Class Tub.

 

Ben 

See what happens when you take the plunge... into LVOOP?

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 21 of 32
(2,164 Views)

ROFL! Smiley Very Happy

 

...seriously though... when you start come up with class hierarchies for everyday activities, you HAVE to get out more 😉

Message 22 of 32
(2,159 Views)

Like when you say the wrong thing to your Wife and you think that if you'd made that data accessor private you wouldn't have broken wires?

Message 23 of 32
(2,126 Views)

@Intaris wrote:

Like when you say the wrong thing to your Wife and you think that if you'd made that data accessor private you wouldn't have broken wires?


Nice!

 

This suggests a new open offer to all.

 

I will award a Kudoes for every LVOOP based phrase/wize-crack that is syntactically correct and is posted to this thread. I suspect it will be a good learning technique for those trying to learn LVOOP. let em fly!

 

I'll also give out Kudoes for corection to other attmepts. I beileve there are a couple in mine.

 

Thank you Shane!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 24 of 32
(2,121 Views)

Hi Darren

 

Try to make more than one cluster of data. You are right, not every int deserves an interface, but clustering together the data items that belong to each other help to make up your mind. And keep them private as long as possible.

 

The problem with your approach Darren is that you are using oop with the mindset focused on procedures with variables instead of data that handles methods in itself.

 

Can you publish some stuff not used in 2010 that we can look at and think over how to approach this with a goop mindset?

greetings from the Netherlands
0 Kudos
Message 25 of 32
(2,111 Views)

@Albert Geven wrote:

Hi Darren

 

Try to make more than one cluster of data. You are right, not every int deserves an interface, but clustering together the data items that belong to each other help to make up your mind. And keep them private as long as possible.

 

The problem with your approach Darren is that you are using oop with the mindset focused on procedures with variables instead of data that handles methods in itself.

 

Can you publish some stuff not used in 2010 that we can look at and think over how to approach this with a goop mindset?


Classes composed of other classes make sense since mods of the Private data for each Class wil only affect the members of that class and the associated users of those methods.

 

But a type def will force a change to all code that uses that cluster.

 

Simple case:

 

I deploy an app with a Class that is fully functional. Latter we decide that we need to add another value to that class. I could mod that Class OR, create a child of the original class and add the new value to the Private data of the new child Class.

 

In that case the orginal Class is un-changed and none of its code needs updated tested etc. Only the new Child Class is subject to suspicion.

 

This same idea applies to classes within classes. By using classes instead of clusters, we minimize the impact of changes on our code.

 

These days I have been thinking more in terms of classes within classes.

 

The idea of using Classes within Classes has simplified my work. If you look back at my post regarding how the CLass Libraray has been incrementally growing, I indicated I used the File Classes withing my Hardware Classes.

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 26 of 32
(2,090 Views)

I use classes within classes in nearly every LVOOP work I do.  I think it opens up a lot of extra functionality without adding excessive amounts of overhead.  When you start combining classes (Composition) then the real power of LVOOP (or OOP in general) starts to show.

Message 27 of 32
(2,082 Views)

I wholeheartedly agrre with classes in classes, but Darren first needs to try to hide data that is only needed for implementation from the interface.

Second step is classes in classes.

 

So maybe somebody can write something about hiding implementation from interface.

greetings from the Netherlands
0 Kudos
Message 28 of 32
(2,018 Views)

I thought I already did a while back.....Smiley Sad

0 Kudos
Message 29 of 32
(2,006 Views)

You are right that is a nice example but maybe the term hiding shows Darren that everybody has something to hide to make it safer.

 

greetings from the Netherlands
0 Kudos
Message 30 of 32
(1,948 Views)