Why I should consider use Data-driven design instead of OOP? Are two concepts that lie…
- User
Why I should consider use Data-driven design instead of OOP? Are two concepts that lie on the same conceptual layer?
- Assistant
- User
I have a buffer, i.e. a continuous memory, that different manipulators manipulate, one following each other, such that Manipulator A will act on this buffer, then it will pass the buffer to Manipulator B, that will act on it, until the last Manipulator, that will store the buffer. Manipulators can be sources (only outgoing sharing of buffer), sinks (only incoming buffer), or vertices (incoming buffer + outgoing buffer). Basically, manipulators are vertices of a directed graph, each of these manipulate the buffer, that once shared is a edge. Do you see any advantage in such task of using a Data Oriented Design?
- Assistant
- User
Can you please provide me a snippet of C++ to see this design? Just consider a source that creates and dummy-manipulate the buffer and a sink that receives it and do some dummy manipulation on it. Just leave out the manipulation, I would like to have a roughly idea about how the code can look like.
- Assistant
- User
Do you see any drawback in such approach?
- Assistant
- User
Coming back to my previous statement, consider an acyclic directed graph, such that I will have three different types of vertices (sources, vertices, sinks) and the links will be a buffer shared between vertices. If I would like to use a DOD principle, while still having some OOP concept, do you have any suggestion about how to design it?
- Assistant
- User
Thank you, one question: Graph class has a process method, that scan linearly the vector of vertices. This means that the user has to safely connect the vertices. There is a way to check that no cycle will be introduced in the graph itself?
- Assistant
- User
Thank you, one additional question: if I have two intermediate vertices that read the same buffer, manipulate it independently each other, and then, for example, go to another intermediate vertice that take the buffers and sum them, before to go to the sink, how I can proceed?
- Assistant
- User
How a task scheduler for such kind of job can look like?
- Assistant
- User
Coming back to the snippet of Graph class which includes cycle detection, the graph is still executed linearly in the order in which the user has added them to the graph using addVertex, while the function addEdge is not used to determine in which order the Buffer has to be connected through different vertices. Am I wrong?
- Assistant
- User
What do you mean with "The topologicalSortUtil is a placeholder for the depth-first search part of topological sorting"?
- Assistant
- User
Let's consider the following case: I have a source and two intermediate vertices, such that I have an edge between source and the first intermediate and an edge between the source and the second intermediate. Both intermediates change the buffer. In this case, I have to implement that will be mutable between source and intermediate 1, namely I can use a move or pass the buffer using reference, while between source and intermediate 2 I have to create a copy of the buffer. Am I right?
- Assistant
- User
In the example discussed before, I had a Buffer that is class that contains a vector and vertices, that belong to a graph, that manipulate the buffer. If I would like to keep the same buffer, it should be graph responsibility to create a copy of the buffer to the second intermediate, while providing it to the first one via reference?
- Assistant
- User
Is it possible even at this simple level to introduce some sort of graph coloring?
- Assistant
- User
From the previous chat we had, is my scope clear?
- Assistant
Based on our previous conversation, I understand that you are interested in creating a system where a directed acyclic graph (DAG) is used to model the flow and manipulation of data through a series of processing steps, represented as vertices within the graph. The vertices are categorized into types such as sources (which only produce data), sinks (which only consume data), and intermediate vertices (which both consume and produce data). The edges of the graph represent the flow of data from one vertex to another, and this data is held in buffers that can be operated on by the vertices.
- User
Yes, actually my main concern is about to deal when a source have two intermediate vertices, and then then two intermediate vertices will reach one another additional intermediate vertex, that will manipulate two buffers simultaneously.
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.