You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are too many models involved at the moment. Models doing too specific things; like one for the app view, one for the Environment tab, one for the Packages tab. Even though environments are part of a Context, as are packages that are each responsible for generating each part of an environment. It's tricky to know where to change things, or where things break. There is some duplication in how data is retrieves.
Furthermore, it isn't clear how to asynchronise data retrieval. Many operations, such as resolving a context and searching for packages to fill in the version combobox of each package, takes time. At the moment, that operation is handled directly in the controller, the models being fed data when really it should be the one to go out into th world and fetch this data, providing the caller with some temporary "I'm working on it"-type data in the meantime.
Implementation
Create a new model, one that is akin to a file-system, with paths, treating folders and files differently. One can have data. The other files.
Why? Files are familiar and flexible. But slow. A FileLikeModel maintains the mental model of a filesystem with the performance of a in-memory datastore.
How?
alita=model.data("/projects/alita")
projects=model.ls("/projects")
model.ls("/projects", callback=on_ls)
# Recursive, projects is deferredmodel.ls("/projects/alita/packages", on_ls)
alita.data(DisplayRole)
# dot-accessmodel.data("/projects/alita.name")
# role accessmodel.data("/projects/alita", DisplayRole)
# path for indexpath=model.path("/projects/alita")
pkg=model.data(path, PackageRole)
Effectively an async QAbstractItemModel. How do others do it? There doesn't seem to be much about that online, or maybe I haven't been looking hard enough.
The text was updated successfully, but these errors were encountered:
Goal
Reduce complexity, improve ease of maintenance.
Motivation
There are too many models involved at the moment. Models doing too specific things; like one for the app view, one for the Environment tab, one for the Packages tab. Even though environments are part of a Context, as are packages that are each responsible for generating each part of an environment. It's tricky to know where to change things, or where things break. There is some duplication in how data is retrieves.
Furthermore, it isn't clear how to asynchronise data retrieval. Many operations, such as resolving a context and searching for packages to fill in the version combobox of each package, takes time. At the moment, that operation is handled directly in the controller, the models being fed data when really it should be the one to go out into th world and fetch this data, providing the caller with some temporary "I'm working on it"-type data in the meantime.
Implementation
Create a new model, one that is akin to a file-system, with paths, treating folders and files differently. One can have data. The other files.
Why? Files are familiar and flexible. But slow. A
FileLikeModel
maintains the mental model of a filesystem with the performance of a in-memory datastore.How?
Effectively an async
QAbstractItemModel
. How do others do it? There doesn't seem to be much about that online, or maybe I haven't been looking hard enough.The text was updated successfully, but these errors were encountered: