The importance of encapsulation / wrapper layer

A question I asked the participants in last week’s training:

Usually encapsulation is understood as a way to hide the implementation details.

While that is true, there are a lot of other great benefits as well.

I learned of these working with Embedded systems and seeing ‘wrapper’ layers implemented.

Just like encapsulation, add your own ‘wrapper’ on top of the library(ies) you want to use.

In trainings and designing frameworks, one of the fundamentals I teach / use is to NEVER use ANY library directly

EVERYTHING used by the POM layer should come from the framework’s own helper library

Which in turn would call any external library / API you want to use.

This way if anything changes / needs to be changed in the way outside libraries are used, the change has to be done in only one method

Also adds portability to your framework, helps a long way in maintainability and scalability of the framework.

#QsDaily #automation #training