User Tools

Site Tools


wiki:observerpattern

Observer pattern and database objects' hierarchy

Disclaimer: This document is only a rough outline for some future documentation. It is used for developers to communicate easily. Is contains a really small subset of what is needed to say about this.

We use a separate in-memory hierarchy of database object, which will be named “Database Hierarchy” or just DBH in the following text. Top nodes of DBH are loaded from servers.xml file (user defined servers and databases), and the rest is loaded from database. To sinchronize nodes with their visual (GUI) representation, we used the Observer pattern.

Now, we have an interesting issue:

Hierarchy of YMetaData objects and wxTree nodes doesn't match 100%. We need to make sure it's done ok. What exactly do I mean:

wxTree (GUI) DBH
top node YRoot, also YMetadataCollection<YServer>
servers YServer, also YMetadataCollection<YDatabase> (since each server has collection of databases)
database YDatabase
tables YMetadataCollection<YTable>
table YTable, also YMetadataCollection<YColumns
etc.

There were many ways to solve that (listed in CVS document: uc_database_open.txt), this one is picked:

In order for things to work smooth, each YDatabase in YDatabases collection, has it's parent data member changed to the YServer object that owns the collection. The same is done for YRoot and it's YServer nodes, and also (will be done) for YTable and YColumns.

wiki/observerpattern.txt · Last modified: 2008/10/18 11:58 (external edit)