v-nys / learning-paths-tauri-react

0 stars 0 forks source link

distinguish more clearly between datatypes for serialization and for domain problems #2

Closed v-nys closed 3 months ago

v-nys commented 3 months ago

Some structs (e.g. Node) implement Deserialize and are used throughout the code. Others have counterparts which enable simpler YAML (e.g. ClusterForSerialization vs. Cluster). This may make it harder to separate responsibilities.

For instance, I want to move ClusterForSerialization to a separate, serialization-related module. The problem with that is that I would have to move Node, too, even though it is a domain datatype. And the distinction between Edge and TypedEdge is not as clear right now, having UntypedEdge in serialization module would be clearer.

Given that ClusterForSerialization has a build method which produces a Cluster, I should move the domain datatypes into a module so that the serialization module uses that but not the other way around.

v-nys commented 3 months ago

Running into some representation issues. Current use of __ is fine for data formats, but should just have namespace be part of a Node. And a TypedEdge should always connect two Nodes by ID, so maybe have something like

struct NodeId {
// namespace and local ID
}
struct Node {
// NodeId and title
}
struct TypedEdge {
// two NodeIds and an EdgeType
}
v-nys commented 3 months ago

Compiles, but getting errors I wasn't getting before. /home/vincentn/Projects/learning-paths-tauri-react/src-tauri/tests/simpleproject;/home/vincentn/Projects/learning-paths-tauri-react/src-tauri/tests/technicalinfo