sudoblockio / tackle

Tackle is a programmable configuration language for building modular utilities, code generators, and CLIs with schema validation baked in.
Apache License 2.0
51 stars 2 forks source link

Context Composition #230

Open robcxyz opened 8 months ago

robcxyz commented 8 months ago

Context Composition

Changing core context from inheritance based object to composition

Overview

This proposal would be for refactoring the core context object from an inheritance to a composition based approach. Would have broad implications across the entire stack. This is some long standing technical debt that needs to be paid at some point.

Benefits

Current Design

New Design

New Layout

v1

v2

Hook Properties


Hook<-:

  Config:  

Reorg

v1

v2

Validators

Old way of doing things was to assert some element is a dict and then check if keys exist in the dict. New way will be to go from element, assert dict, then constructor to create pydantic objects catching every validation error, then to business logic.

POCs