Comments on framework understanding¶
- The framework architecture is mainly based on 3 metaclass inheritance trees with the roots:
MetaState
(actuallyMetaSingleton
),MetaStateObjectContainer
andMetaStateObject
. The metaclass inheritance structure of theMeta*
-classes is in fact merged together with the regularFrame*
-class inheritance structure. TheFrame*
-classes can be understood as the base classes of the framework which then are inherited by theBase*
-classes at the feature development interface. This way with the code of oneMeta*
-submetaclass one can create at the same time a new subtype as well as a new regularFrame*
-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 regularFrame*
-class method/attribute/descriptor inheritance duringMeta*
-class inheritance@namespace_item
to decorate theFrame*
-class’ mehtods & attributes inMeta*.__new__()
implementing a more regular class like inheritance behaviour forFrame*
-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
Arugment
s,Helper
s andIngite*
state components
Reasons for “sandwiched” metaclass inheritance structure:
- reduction of code and cod redundancy by implementing only on inheritance tree for
Meta*
andFrame*
-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.