Hi all.
I trying to call a privated method of a STANDAR_YYYY standar class(this class have all its methods privated). I see that this Class have a interface IF_STANDARD_YYY.
I have other ZXXXX class and it have one attribute YYYY_ATTR TYPE REF TO STANDAR_YYYY. In a method i instance the standar class (create object YYYY_ATTR...) but when i try to call a method <b>YYYY_ATTR->method1</b> i have a error activing the object ("you cannot access privated method YYYY_ATTR->method1). I was thinking that maybe using the interface IF_STANDAR_YYY in my ZXXXX class i will to call the private methods of the standar class STANDAR_YYY but when i did it obtanin this error "Before the IF_STANDARD_YYY statment, the interface in question must be fully defined". <b>What is wrong ?????</b>. If anybody can help me please!!!
Usually, in Object Oriented Programming, you can't access private methods out side the class that defines them.
If you want to access these methods, you MUST use the class that defines them, using interfaces don't makes an private method to be accessed from another class and you can't access a private method from a class that inherites from the private class.
There is no other way that use the class that defines them, or to make a manual copy of them :).
Maybe it will be helpfull for you to read Design Patterns in Object Oriented, I think Composition Pattern (I think this is the name of the pattern) is the one you must refer to.
Add a comment