CrxOop CrxOop: Bringing Object Oriented Programming, and Proper Prototype Based Programming, To Javascript
The aim of the library documented below is to provide developers with a solution to allow development using interfaces and classes as they are known in other object oriented programming (OOP) languages such as C++, C#, Java and PHP. Further more, V1.4 introduces structures, a generalization of the concept of prototypal inheritance, known here as POBP.
Subject
Body*
Email
SUBMIT CLOSE
Menu

1.5 Modes of Operation

The library has two modes of operation, a flag which I shall call here "mode_crxOop".

Mode_crxOop is related to whether the data structures representing class instances created by CrxOop are structurally protected from tampering with when possible or not. This flag is set explicitly using the function "crxOop.setStrictMode()" which takes a single argument, a boolean for the value of the flag. The function must be called before any class registration or interface registration takes place.

Making the call "crxOop.setStrictMode(false)" is not recommended but we provide it because it can make significant performance difference if you are creating a lot of class instances, which should be a very rare case. Remember that this also compromises security. For that reason, we also provide the function "crxOop.areStructuresLocked()" which takes no arguments and returns true if structure integrity is protected, otherwise false.

Note that not making the call "crxOop.setStrictMode(false)", or explicitly making the call "crxOop.setStrictMode(true)" does not guarantee the call "crxOop.areStructuresLocked()" to return true. Hence, for secure application you might want to consider making the call to "crxOop.areStructuresLocked()" regardless before running your secure code.