In a Safety Critical systems, one of the most important aspect is certification and maintainability. Obviously, the second part will be easier with encapsulation, and in fact the first on too because it is easier to track issues or to prove something when you have encapsulation (for example you can check with a few line of debug the value assigned to an attribute during the execution).
Concerning the overhead, you can avoid most of it using inline
C function or Ada pragma Inline();
, so you still have encapsulation (you cannot access attributes using the .
or ->
accessor) but using a getter will be inlined and so no (or few) overhead will be added.
I don't know if it is used in the real industry, but I don't see why it should be avoided. In fact, the real problem may be that industrials do not use, as you said, modern version of Ada with OOP or modern C version with inline
functions (comes with C99).