[refacto] middleware routines
Possible architecture for pyat
Decoupling usage (e.g. the specific json->json function, or json->files process) and implementation (e.g. the generic json->files call to scripts) with a module containing the routine procedures, only needed interface for most PyAT clients.
@ld202a8 is working on a differentiation between Functions and Processes when calling Python scripts in Globe. If from Globe point of view each fullfill a very different objectives, from PyAT point of view, Functions is a specific case of Processes and therefore is implemented using Processes and a specific return value.
To both convoy the semantic differences between these two PyAT script calls (one is yielding JSON to be handled by Globe, one is writing files to add to Globe loaded data), and keep the PyAT code base clean, i propose to put these client-aware procedures in a specific module that will therefore be the main interface for clients using PyAT. In that module, PyAT would provide an interface/function/class for Functions, another for Processes. Their implementation would consist into the call of PyAT procedures.
This would be solved by putting a
routines module (or
interface, or anything clear enough) containing functions useful to the client abstractions (i’m thinking Globe now, but maybe there is others that would be happy to incorporate their low-level semantics ?), and a
from .routines import * in the
Plus, maybe existing functions of PyAT will find their place in that module.