Monitoring of private properties overriding. The Terrasoft.PrivateMemberWatcher class
Glossary Item Box
Introduction
Starting with version 7.12.0 version you can override private properties via the Terrasoft.PrivateMemberWatcher class. When defining a custom class, this functionality checks whether the private properties or methods declared in the parent classes have been overridden. The warning is displayed in the browser console in debug mode.
ATTENTION In bpm’online, the private properties and methods of the class are starting with underscore (for example, _privateMemberName). |
For example, a module schema with the source code given below was added to a custom package:
define("UsrPrivateMemberWatcher", [], function() { Ext.define("Terrasoft.A", {_a: 1}); Ext.define("Terrasoft.B", {extend: "Terrasoft.A"}); Ext.define("Terrasoft.MC", {_b: 1}); Ext.define("Terrasoft.C", {extend: "Terrasoft.B", mixins: {ma: "Terrasoft.MC"}}); Ext.define("Terrasoft.MD", {_c: 1}); // Overriding _a property. Ext.define("Terrasoft.D", {extend: "Terrasoft.C", _a: 3, mixins: {mb: "Terrasoft.MD"}}); // Overriding _c property. Ext.define("Terrasoft.E", {extend: "Terrasoft.D", _c: 3}); // Overriding _a and _b properties. Ext.define("Terrasoft.F", {extend: "Terrasoft.E", _b: 3, _a: 0}); });
Then, after loading the module via the browser address bar (see “Client Modules”), a number of warnings will be displayed in the console (Fig. 1).
Fig. 1. Warning message for overriding private members of the class