Field Encapsulation - Disadvantages

Disadvantages

  • Access to a subroutine involves additional overhead not present when data is accessed directly. While this is becoming of less concern with the wide availability of fast general-purpose processors it may remain important in coding some real-time computing systems and systems using relatively slow and simple embedded processors.
  • In some languages, like C++, the getter / setter methods are usually inline functions, so that when inlining is performed, the code looks just like direct field accessing.

Read more about this topic:  Field Encapsulation