Search code examples
oopreflectionencapsulationabap

Is it possible to violate Encapsulation by Reflection in ABAP?


Is it possible to:

  • Read / Modify the content of a private member variable?
  • Call a private method?

..from a context where these are not in scope?

Not planning to do any architecture like this, i just want to know if it's possible.


Solution

  • Since the debugger is written in ABAP and the debugger can display the contents of private members, the former is possible (if not easy - you have to do some really risky low-level stuff I'd not recommend for obvious reasons). For calling private methods, I'm not sure but I'd doubt that it's possible.