Should filters be part of spec? #549
Replies: 2 comments 4 replies
-
I tend to disagree with you here, @globalflea. IMO, providing filtering at worklow level allows the exact opposite of what you are implying: it decouples business from the workflow. External services should return whatever data they deem fit in order to fulfill their goals, independently, and the workflow should just orchestrates, filters, aggregates, transforms, etc. data from different sources in order to achieve its own goals. Obviously, if data returned by external services changes, the orchestration part (aka the workflow) should change as well, or should at least be written in such a way it wouldn't be too much impacted by model changes. |
Beta Was this translation helpful? Give feedback.
-
@globalflea @cdavernas I'd like to look into a possible way to explicitly disable data filtering. Runtimes can do that on their own but having a way to define that in dsl might be good to have. I don't know if this should also include expression type functions, as really they can be used for filtering or even add/remove/restructure data as well. WDYT? |
Beta Was this translation helpful? Give feedback.
-
After some thinking, It feels strange to me that filters (state or action) expression is part of the specs as it means that business logic is divided between external functions (via REST, GraphQL, etc) and within the specs. Imagine if i modify a filter expression in the specs, i need to know the impact to called external functions since the inputs to these functions are now different?
Also, there's a need to work through the overall mutation to the messages as it flows into a state (state filters) to actions (action filters) then to external functions, subsequently again to action (action filters) and state (state filters) which couples the spec tightly with the biz logic - may be better if the spec just focus on control flow
I think it would be better if the spec were simpler and leave any filtering to the external functions if necessary. If there's a need to modify/filter a data before being processed by a function (biz logic), this can be achieved by adding another function (filter data) prior to calling the final function (biz logic)
Beta Was this translation helpful? Give feedback.
All reactions