07-20-2010 11:24 AM
@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?
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?
07-20-2010 11:27 AM
ROFL!
...seriously though... when you start come up with class hierarchies for everyday activities, you HAVE to get out more 😉
07-20-2010 02:16 PM
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?
07-20-2010 02:23 PM
@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
07-20-2010 02:40 PM
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?
07-20-2010 03:01 PM
@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
07-20-2010 03:25 PM
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.
07-21-2010 03:06 PM
07-21-2010 03:33 PM - edited 07-21-2010 03:34 PM
I thought I already did a while back.....
07-22-2010 02:59 AM