[Qgis-developer] [QGIS Commit] SVN [godofredo] r7284 - branches/ogr-plugin-branch/src/app

Martin Dobias wonder.sk at gmail.com
Sat Nov 10 07:59:32 EST 2007


On Nov 8, 2007 4:14 PM, godofredo contreras <frdcn at hotmail.com> wrote:
>
>            The idea to keep qgsdatabaseconnectionbase and
> qgsconnectionmanager is to reuse
> this classes in the refactoring of spit and for the ogr plugin(layer cretion
> and utilities), If we move them to app
> how could we call that classes?

Ah, I thought that you would implement that loading of layers directly
in application and not as a plugin. Right if they're moved out of core
lib they're not accessible for providers/plugins.

Anyway, I still do not understand completely your design... and I fail
to find any information about it, how it will be bound to the rest of
QGIS and what will be changed.

QgsConnectionManager does some managing of connections. This class is
not well designed as it depends on all supported types of connections.
Imagine that we want to add native oracle connection - in that case we
would need to modify also this class - that's not very nice. My
suggestion is to make it more generic: all provider-specific stuff can
be propagated to the Qgs*DatabaseConnection classes.
E.g.  QgsConnectionManager::connect() would get just one parameter:
pointer to QgsDatabaseConnectionBase and will do the connection. Or
QgsConnectionManager::saveConnection() won't have hardcoded 'baseKey'
for every type of connection but will ask for it using 'mConnection'
instance. Does this make sense for you?


>            Also I was thinking in using a similar aproach to
> QgsVectorLayerin QgsDatabaseConnectionBase but
> checking the code I saw that QgsProviderRegistry::instance() gives access
> just to provider class not to other
> classes compiled in provider(assuming that we move
> qgspostgresdatabaseconnection and qgsogrdatabaseconnection to their
> respective
> provider), do you know if there are a form to access other classes in the
> provider in runtime?

I don't understand exactly the relation between Qgs*DatabaseConnection
and according provider so I don't know.

I hope you don't take my complains as a bad critism of your work - I
just try to keep core library in a good shape.

Martin



More information about the Qgis-developer mailing list