OC-301e · Module 1
Extension Point Design
4 min read
An extension point is a place in the framework where a plugin can insert custom behavior without modifying the framework itself. The design of extension points determines the plugin system's power and its fragility. Too few extension points and plugins cannot do anything useful. Too many and the framework becomes unpredictable — every operation is interceptable, every data flow is modifiable, and the system behavior depends on which plugins are loaded in which order.
The extension point taxonomy has four categories. Hooks: functions called at specific lifecycle moments — before task execution, after output generation, on error. Hooks observe and modify data at defined points. Providers: implementations that the framework delegates to — storage providers, authentication providers, notification providers. Providers replace default behavior with custom behavior. Transformers: functions that modify data flowing through the pipeline — input transformers, output transformers, event transformers. Transformers intercept and modify without replacing. Listeners: passive observers that receive events without modifying them — audit logging, metrics collection, monitoring. Listeners read but do not write.
- 1. Map the Pipeline Document every stage of the framework's core pipeline: input reception, task routing, execution, output generation, delivery. Each stage is a potential extension point. Mark which stages should be extensible and which should be sealed.
- 2. Choose Extension Type Per Point For each extensible stage, select the appropriate type: hook (modify at a point), provider (replace a capability), transformer (modify in transit), or listener (observe only). The type constrains what plugins can do at that point.
- 3. Define the Contract For each extension point, specify: the input the plugin receives, the output the plugin must return, the constraints on execution time, and the behavior if the plugin fails. The contract is the boundary between framework stability and plugin flexibility.