class Composition(NamedTuple):
resolution: Resolution
framerate: Framerate
duration: Duration
data: List[Layer]
class Layer(NamedTuple):
layer_type: ClipType
layer_name: Name
layer_args: ARGS
class CompositionExecuter:
def __init__(CompositionReader, CompositionRenderer)
def execute(Composition):
validated_data = reader.validate(composition)
await renderer.render(validated_data)
class CompositionRenderer:
def __init__(LayerRenderer)
def render(CompositionSpec):
instatiate each layer using _module_
...
process the composition rendering
class CompositionReader(CompositionProvider):
def __init__(LayerReader)
def provide_composition_spec(Composition)-> CompositionSpec:
validate each layer using LayerReader
...
return validated Composition
class LayerSpec(BaseModel):
1. provide generic mechanism to validate variadic 3rd party _module_ classes
2. validate layer type belongs to _module_
3. validate layer arguments are legal to the type