Skip to content

Interface Concept

ALexeyP0708 edited this page Jul 5, 2020 · 3 revisions
  1. A class is declared that is marked as an interface.
  2. In the Interface, each interface member forms its own verification criteria.
  3. An interface is inherited (direct / indirect inheritance) by a class or assigned through an interface manager.
  4. Using the interface manager, interface rules for the class are generated, and sandboxes for class members are also assembled.
  5. Interface rules are generated recursively for each class in the prototype chain.
  6. When generating interface rules, interfaces are compared / combined into a single rule. For each interface, interface rules are generated from their own generated rules and the rules of inherited interfaces.
  7. After generating the interface rules for the class, the process of validating the class assembly according to these rules starts.
  8. Validation of arguments and return results for methods or reactive properties of a class occurs at the moment the method / reactive property is executed.
  9. Interface rules are initialized once and all declared properties / methods / reactive properties are removed from the interface.
  10. For each class, its own rules are generated from inherited interfaces once. These rules are then used throughout code execution.
  11. The class inherits (clones) the rules of the parent class.
  12. If validation fails, an exception is thrown