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

Refactor of DbImporters/Changes in DB access #207

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

mikejbuckingham
Copy link
Contributor

Removed derived importers : Database and NonPersistent. We now only have one importer class, preliminarily named medImporter.

Changed how we import data : controllers are no longer responsible for the creation of the importer, and are instead passed as an argument. Importer doesn't take ownership as the controllers are singletons.

All access to the DB should (in theory) go via the DataManager now. There are a few remaining cases where this isn't true, but I want to analyse how to handle them first.

Please give feedback - I'm aware the medImporter file is now massively bloated, and some further code cleanup can/should be done, but from an architectural perspective we've cut out some unnecessary problems and reduced coupling in the database handling.

QList<medDataIndex> indexes = medDatabaseNonPersistentController::instance()->availableItems();
QList<medDataIndex> patients = medDatabaseController::instance()->patients();
if (indexes.isEmpty() && patients.isEmpty())
if (medDataManager::instance()->empty(medDataManager::AllDatabases))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer isEmpty() to empty(), one is clearly a boolean test whereas the other sounds like an action (a call to it will "empty" the database rather than test for emptiness)

@fvichot fvichot added this to the medInria 2.3 milestone Dec 30, 2014
@fvichot
Copy link
Contributor

fvichot commented Jan 22, 2015

I just noticed you renamed medAbstractImporter to medImporter, when for consistency it should be medDatabaseImporter.

@rdebroiz
Copy link
Member

rdebroiz commented Sep 8, 2015

Seems to be a good refactor of the DB.

But i have some troubleshooting while loading some plugins (some methods of some class are not implemented anymore I guess)

Anyway, it doesn't fix any bug or improve something for a user point of view, so I think it would be safer to look for merge this one after the next release.

;)

@rdebroiz
Copy link
Member

rdebroiz commented Sep 8, 2015

But i have some troubleshooting while loading some plugins (some methods of some class are not implemented anymore I guess)

Forget what I said, It's just a matter of rebase on the master.

@ocommowi ocommowi modified the milestones: 3.0, 2.3 Jan 12, 2016
@ocommowi
Copy link
Contributor

Should this be in 3.0? Clear milestone if not

mathildemerle pushed a commit to mathildemerle/medInria-public that referenced this pull request Feb 10, 2017
@mathildemerle mathildemerle removed this from the 3.0 milestone Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants