Passing parameters as object or as primitive?

0
If I need one or two attribute value(s) of an object in a microflow. Is it better to pass the object or the separate attribute value(s) to a (micro)flow? Please answer in terms of readability, reusability and performance.
asked
1 answers
2

In case of one attribute: only pass the attribute. This has better readability over passing the object because in the calling activity you can see what attribute is getting used and in the called flow your parameter is a simple datatype rather than an object. This also improves the re-usability of the called flow, since now you can also call the called flow passing a value of just that attribute-type instead of needing to create the unused object around it.

It will perform better, but merely theoretical. You will have a hard time noticing the difference.

When passing two or more attributes, it becomes a judgement call. Code-quality tools do not want you to pass many parameters. 2 is ok, 3 or 4 is frowned upon and you will get more penalty-points the more parameters you add. The arguments of readability and re-usability rapidly decline too.

answered