Does anybody do class based development and deploy...
# ask-community
m
Does anybody do class based development and deployment with flow code or is this some sort of an anti pattern in Prefect? For example, I would have a common parent flow that retrieves data to pass to different types of subflows. • Is it better to inherit that parent flow and deploy with each of the subflows under the same deployment space? ◦ parent_flow/deployment_1, subflow/deployment_1, parent_flow/deployment_2 and subflow/deployment_2 • Or is it better to make the parent it's own separate deployment. ◦ parent_flow/deployment_x, subflow/deployment_1, subflow/deployment_2
n
hi @Mitch - could you elaborate on what you mean by "class based development"? generally prefect encourages a functional paradigm, flows can be deployed independently, but also called anywhere by another python function
a
That clarifies it for us. If prefect is designed around the functional paradigm then that's the development process that's encouraged here.
👍 1
m
noted, thank you
n
fwiw i will say though, we’ve become a bit more lenient on that in prefect 3, where you can have instance/class/static methods as tasks or flows, but that’s more removing what feels like an arbitrary restriction rather than a design recommendation, generally i’d say tasks are still units of work and flows compose units of work, and i think of things functionally most of the time!