FBP usual approach is to exchange data between components.
Data can be any, from few bytes to enormous amount of data.
But sometimes it might be all data is not needed, some references to data is sufficient.
For example we might have large data database.
First component will do some initial scan and find range of records.
Component output is range start and end references.
Next component will do something with records in range, but actually not all records in range are needed.
So its not wise to read all records in first component and send them to second component.
This might be even not possible, amount of data might be too large.
I think using references instead of actual data is OK.
Of course this works when data is read only and doesn't change during processing.
I have a feeling sharing data this way is not FBP style or even bad practice?
What do you think?
Are there better ways?
Thanks
Toivo
My opinion is.It all depends on the planning application architecture. Assuming that every block Diagram function is written by the end user, all depending on the data structure. If you work with an image, it will transmit path to the image. If you work with the database records, it is better to transmit unique identifiers records between blocks. In this case, each unit can download data directly from the database.
--
You received this message because you are subscribed to the Google Groups "Flow Based Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-progra...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Thank You all for your feedback.
I misused reference meaning.
Often data transfers are technically by reference, as Paul said.
I wanted to say that component will not receive all data (be it by reference, direct data, copy, etc).
Instead only some pointers to data will be sent between components. (let's use pointer instead of reference)
In case of database pointers might be Primary keys.
Or in case of large list pointers might be element indexes.
As I understand FPB does not is stop such approach.
But I am little bit concerned how shared data source fits to picture.
See things like CRDTs, perhaps.
See things like CRDTs, perhaps.
Thank You all for your feedback.
It's much clearer now.
And I received a lot of valuable information.
I try to avoid any modification of data which is obtained using shared resource.
Means data is strictly only read. And data must not change during processing by FBP flow.
So, no locking, no transactions, etc.
Processes (components) will only read data.
At the moment for me open question is:
Where I put shared resource in flow diagram?
Definition:
“FBP defines applications as networks of "black box" processes, which exchange data across predefined connections by message passing, where the connections are specified externally to the processes. These black box processes can be reconnected endlessly to form different applications without having to be changed internally. FBP is thus naturally component-oriented.”
Shared resource is not ordinary process.
And it’s not connected to other processes by message passing in usual way.
At the same time Shared resource is part of the processing, part of the network (flow).
Thanks
Toivo