05-02-2014 11:21 AM
OK, so I don't know if it's a bug, a poor design decision, or my lack of understanding, BUT here goes...
(talking LV2013 here)
I have two preant classes, from which I am making plugin child classes.
I would LIKE some of their methods to be restricted from the Public sphere.
So... I make the two classes Friends, and the methods Community. It works great!
However... their plugin Child classes CANNOT access these Community methods.
That seems stupid to me. It means I have to choose between having child classes and accessing friends' methods. If children inherent their parents' methods then why can't they inherit the ability of their parents to access their friends methods?
I think I am going to have to create protected parent method wrappers around friend methods?
Any insights would be appreciated. I'd really like to see this changed, but not being a LVOOP expert like so many of you out there, I'd love to learn the rationale behind this.
Any insights?
05-02-2014 12:22 PM
to access your parents friends you must use the parents method or make the child a friend of the parents friend. You have to "Make your own Friends" you don't inherit them.
it keeps the rowdy children from accidentally overriding the parent's friend's method ( which would be really really bad behavior of the child)
05-02-2014 02:37 PM - edited 05-02-2014 02:52 PM
When it comes to decisions behind the design with regards OOP in general, I tend to find it helpful to look for the answer with regards to C++ or more "established" OOP programming languages. Often times I find a lot of these questions have been asked before.
Here is a related link
Essentially, this gives you the ability to allow children access to the frienders data if you feel they may need it (make it available in protected parent method wrappers), but does not automatically allow it. Think about if you wanted some of the friender's methods available to the friendees' children, but not all the methods? You'd have no way to do this if all methods were automatically available to the children. There are other reasons as well in the link above but I won't reiterate for redundancy redundancy sake.
05-02-2014 03:45 PM
>>I think I am going to have to create protected parent method wrappers around friend methods?
I'm not aware of a better solution than this, and this scales better than growing the Friends list for every new subclass you may add in the future.