sfmc-devtools icon indicating copy to clipboard operation
sfmc-devtools copied to clipboard

[TASK] replace underscore with hash names for private class features

Open JoernBerkefeld opened this issue 1 year ago • 0 comments

hash names

_myPrivateField --> #myPrivateField _myPrivateMethod --> #myPrivateMethod

Advantage: javascript/node enforces its privacy. It simply disallows using that method outside of its scope

Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields

get and set

Also, introduce getters and setters to disallow directly accessing certain variables (e.g. Util.OPTIONS).

problems

  • helper libraries are objects and not classes right now, including util.js. This would need to be changed potentially

Both changes together should ensure a more reliable and more readable overall solution with fewer or no shortcuts.

JoernBerkefeld avatar Apr 24 '23 07:04 JoernBerkefeld