Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple Tree View Model and OS File Structure #47

Open
Rob4001 opened this issue Sep 18, 2016 · 1 comment
Open

Decouple Tree View Model and OS File Structure #47

Rob4001 opened this issue Sep 18, 2016 · 1 comment

Comments

@Rob4001
Copy link
Collaborator

Rob4001 commented Sep 18, 2016

For the sake of testing and cleaner code i think it would be a good idea to decouple the model we use to render the Tree View and the underlying file directory structure

@joerick
Copy link
Member

joerick commented Sep 19, 2016

Hey Rob, could you give a little more detail how this would work? I'm not sure this is the best way forward, since the current model code is quite clean and readable, and is working okay to support the user experience we want.

The old Tide for Mac worked in a similar way to how you're describing, but using a framework-supplied class that would do the loading/saving etc. It worked okay, but had some drawbacks- all files (including large resources) had to be loaded into memory while it was open (since the data wasn't simply living on the filesystem), and file-watching was much trickier to implement. The way it works currently, the folder structure in the model always matches the folder structure on disk. If we decouple, in-memory model might not match, so it's not clear where added files would go.

My other thought is that by writing tests with a real filesystem, we expose platform inconsistencies - which is a good thing. Writing tests against these, using files in an OS-supplied temp folder is a bit more work, but I think provides better results.

But I might be getting the wrong end of the stick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants