Framework Core Library Construction: Engines and Plugin Execution
Engines
In the framework-core
library, an Engine
is a vital component tasked with orchestrating the execution of plugins. It operates based on a tool-config
, which outlines a specific sequence of plugins and groups for execution.
The Engine is responsible for managing the execution flow, handling errors, and facilitating event callbacks, collectively ensuring a robust and efficient system for plugin operations within the framework.
During the initialization phase of the Engine, the Registry
is introduced to manage registered plugins. The framework-common-extensions
supply a set of default plugins, while the system remains open to the registration of additional plugins as necessary.
Engine Execution
The BaseEngine
class introduces the execute_engine
method. Key functionalities include:
- Accepting an engine portion of a tool-config and user options as parameters.
- Iterating through the tool-config to execute each plugin or group of plugins as defined passing the store and options along.
Store Mechanism and Automatic Fixes in Plugin Execution
Store Mechanism
The store
serves as a fundamental data structure within the tool-config execution process, acting as a shared repository of data among plugins. Its primary roles include:
- Data Accumulation: As plugins are executed, they can read from and write to the
store
, effectively sharing and accumulating data. - Information Passage: The
store
facilitates the transfer of information along the execution chain, ensuring continuity and context preservation.
Store Usage
During plugin execution, the store
is interacted with as follows:
- Data Retrieval: Plugins extract data previously set by their predecessors.
- Data Modification: Plugins contribute to the
store
by introducing new data or altering existing entries. - Contextual Integrity: By centralizing data, the
store
guarantees that each plugin has access to the comprehensive context required for its operation.