• Docs >
  • Comments on framework understanding
Shortcuts

Comments on framework understanding

The framework architecture is mainly based on 3 metaclass inheritance trees with the roots: MetaState (actually MetaSingleton), MetaStateObjectContainer and MetaStateObject. The metaclass inheritance structure of the Meta*-classes is in fact merged together with the regular Frame*-class inheritance structure. The Frame*-classes can be understood as the base classes of the framework which then are inherited by the Base*-classes at the feature development interface. This way with the code of one Meta*-submetaclass one can create at the same time a new subtype as well as a new regular Frame*-subclass. It merges all advantages of metaclasses and regular classes together with only few limitations. This “sandwiched” 2-in-1 architecture is realized with:
  • Meta*.__new__() implementation enabling regular Frame*-class method/attribute/descriptor inheritance during Meta*-class inheritance
  • @namespace_item to decorate the Frame*-class’ mehtods & attributes in Meta*.__new__() implementing a more regular class like inheritance behaviour for Frame*-class’ methods, atributes and descriptors. For the regular classes this results in a overwriting instead of overriding of its attributes and methods during inheritance (Frame*-subclass overwrites class attributes/methods if its superclass).

Further reasons for metaclass implementations:

  • code reduction
  • enables automatic categorization (setting itself as attribute of correct state container)
  • hide infrastructure variables (e.g. MetaState._variable_overload_suffixes, MetaState._state_shortcuts, MetaStateContainer._integrated_state_component_attrs, etc.) and methods (t.b.i.)
  • runtime class generation of Arugments, Helpers and Ingite* state components

Reasons for “sandwiched” metaclass inheritance structure:

  • reduction of code and cod redundancy by implementing only on inheritance tree for Meta* and Frame*-classes
  • increased reduction of update abnormalities
  • increased stability due to increased error/bug propagation/inheritance

The framework also implements a vast amount of dunder methods, especially __get__, __set__, __getattr__, __setattr__, __getattribute__, __new__ etc.. Therefore one has to be aware how to get or set attributes in which class.

And so on… time for a coffee, I guess.