Extension Architecture
Jonathan Coles
jonathan at jpcoles.com
Wed Apr 6 18:15:36 CEST 2005
Am Mittwoch, den 06.04.2005, 17:37 +0200 schrieb Bernhard Reiter:
> Am 6. Apr 2005 um 10:13:28 schrieb Jonathan Coles:
> > i believe the ExtensionRegistry is the right way to go. i was about to
> > write one myself when i noticed that there is already one in UI/.
> > however, this class should not be in UI but in Model because extensions
> > are a concept which is not specific to the UI but a generic feature of
> > thuban. All extensions should be required to register before they can be
> > used and the add() method should also take an Extension instance.
>
> Just a wild guess: It might be in UI, because we had the problem
> to display the registered extensions. And the extensions themselfs
> should not depend on UI so they can be automatically tested.
the init_callback function may make use of UI components so it should
not be called unless there is a gui available. however, this can be
tested for (an example is in the ogr extension __init__.py), so the
actual callback function can be changed depending on whether we are
running the tests or not.
under normal operating conditions, init_callback would initialize
everything properly (model and gui components). under test conditions, a
different init_callback would be specified which would not initialize
the gui part and allow the tests to run.
this problem is up to the extension to handle properly. the idea of an
extension registry should really be part of Model, not UI.
please also understand, that i am proposing these changes as part of an
overall architecture design change. as the code stands now it is fine
for what it does, but if we want to make the extension model more
complete then it makes sense to move ExtensionRegistry out of UI and add
more generic functionality.
--jonathan
--
=====================================================================
Jonathan Coles http://www.jpcoles.com
jonathan at jpcoles.com GnuPG Key: /gpg_pub_key.asc
=====================================================================
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)