DCMLab / tree-annotation-code

source code for repository tree-annotation-app
GNU General Public License v3.0
0 stars 2 forks source link

separate db access from data transformation #7

Closed chfin closed 4 years ago

chfin commented 5 years ago

Operations on the data structure in the database should be pure functions and just return the new data structure. Updating/dereferencing the db ref should be a separate step.

dharasim commented 5 years ago

That sounds good. I just find it hard sometimes to draw the boundary here. My priority was to write queries that don't expose the structure of the database outside of its namespace. But I'm sure there are query functions in the code that could be refactored into a pure function and a more primitive database update. Do you have specific examples of those?

chfin commented 5 years ago

I'll have a look through the code. If I find a consistent way to do this, I'll make a PR.

dharasim commented 5 years ago

Nice!

chfin commented 4 years ago

solved by #11