Blender python, what design pattern the Operator class is designed I'm new to Python scripting, and is confused with the design pattern it's used so I do not quite understand how this class works, here is a code example,
class HelloWorldOperator(bpy.types.Operator):
    bl_idname = &quot;wm.hello_world&quot;
    bl_label = &quot;Minimal Operator&quot;

    def execute(self, context):
        print(&quot;Hello World&quot;)
        return {'FINISHED'}

From the execute() function, how this function is called by Blender and where this 'self' and 'context' comes from remains a mysterious, it has to be somewhere in Blender to call this function.
To sum up a bit, the user defines the real function (the function to be follow a predefined pattern, the function name pattern, the return pattern etc.), then being called by Blender, what design pattern this is?
The HelloWorldOperator derives from the bpy.types.Operator base-class.
The self variable is a Pythonic class pattern, it is similar to this in C++ like languages. The class variables declared in the class header, e.g. bl_idname and bl_lable, are shared across all instances of the class. The self dictionary contains the per-instance variables and is always the first argument in a Python class method. It is automatically supplied on method calls.
The context comes from the Blender environment and contains pointers to the active object, collection, GUI mode and other things.
Classes deriving from bpy.types.Operator are high-level functions designed to be used as GUI callback functions. As such they only return GUI status.