-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Singletons #42
Comments
|
QgsCrsCache has been removed now |
|
I like this idea. It makes sense to just have a single place for everything and not singletons all over the place. @wonder-sk thoughts? |
|
Since QgisApp is not used in core/, and since I guess you don't intend to introduce the dependency, I understand this change implies that QgsProject::instance() will have to go out of core... do I understand well? If it's the case +1 for me. |
|
I think so. My favorite approach would be to drop |
Observation: Question: |
|
I wasn't quite sure how Credentials and AuthManager work exactly, my proposal is likely wrong. |
|
IMHO AuthManager in concurrent server context can be simplified stopping and starting server during permission management. BTW this depend if qgis server will evolve to a full featured map server instead of focusing more on the rendering task. |
|
qgis/QGIS#3914 fixes:
|
|
@luipir not sure if that's what you were asking for, but |
|
@elpaso, AuthManager does not only manage sqlite queries but also internal state and variables... here we can have concurrence problems. Btw I agree that singleton still continue to work in qgis server context. The context premise is where qgis server does not evolve with a web managing interface with multiple managers at the same time. I'm not used in QGIS server, but IMHO A common use case is where qgis desktop is used to manage configuration for the server => single manager. Am I wrong? |
|
@m-kuhn wrote:
They only communicate via a signal slot connection at the instance level between singletons. QgisApp is the parent of QgsCredentialDialog::instance. For Server, the master password and database are defined via env variables, so no QgsCredential::instance (or any of its subclasses) is used.
The design is for only one, as it is app-relative. Shared server instances or concurrency was never designed for. I'm looking into a QEP and API refactoring for the auth system, so would like to figure out the best design approach going forward. Can you explain further what you envision a 'shared server scenario' as? Currently, the SQLite |
No vision at all, maybe the server team does have one? I'm happy to keep one per process (and not project) if that is fine for server. |
|
@pblottiere @rldhont
Thanks for helping in cleaning up here ! |
|
Here's the current list App - should become members of QgisApp::instance():
Auth:
Core:
Gui:
Server:
The 4 GUI singletons are handled by qgis/QGIS#4514 |
|
No more GUI singletons -
Can be removed from the list |
|
QgsAuthManager can be removed from the list |
|
qgis/QGIS#5535 removes QgsCoordinateTransformCache singleton |
Singletons have been discussed a lot as something to fix for 3.0.
A possible path forward may be to have one single singleton on top which owns all other "singletons" which would then explicitly be created and managed from this root singleton. This would give us full control over initialization order and allow instancing them from other points as well.
QgsGpsConnectionRegistryQgsPaintEffectsRegistryQgsCRSCache/ QgsCoordinateTransformCache (is there an internal dependency between them?)QgsColorSchemeRegistryQgsDataItemProviderRegistryQgsPluginLayerRegistryQgsRasterRendererRegistryQgsRendererV2RegistryQgsSvgCacheQgsSymbolLayerV2RegistryQgsMessageLogQgsMapLayerRegistryQgsAuthManager/ QgsCredentials (I guess unlocking should not be controlled globally? Is there an internal dependency between them?)Feedback on and changes to the above structure are expected and encouraged!
The text was updated successfully, but these errors were encountered: