db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Schindl <tomatli...@gmx.at>
Subject Re: Running Code Analyzer
Date Thu, 20 Apr 2006 22:49:41 GMT
Nevertheless it would be greate if Model-Classes would propagate
PropertyChangeEvents when some internal value changes, wouldn't it?

Not holding duplicate information is one problem which you can address
as you already stated. Another one is what is done if I suddenly remove
a table from the database => foreign key also has to be removed, ... .


Thomas Dudziak wrote:
> On 4/21/06, Tom Schindl <tomatlinux@gmx.at> wrote:
>>Well suppose I'm writing a modelling tool based upon your Model-Classes
>>having created 2 tables and foreign key constraint. After that I see
>>that I have a typo in the name of the the foreign-key provider table, if
>>I now rename the table by setting setName() the ForgeinKey-Reference
>>doesn't get informed about this and as result the internal structure is
>>_foreignTableName != _foreignTable.getName()
>>if i would now write dump the the files to db.xml I could not load it
>>the next time.
>>The same applies when renaming columns ;-) I think all this situations
>>can be dealt with easily when adding PropertyChangeSupport to all model
>>classes and e.g. the foreignKey-Instance adds itself to the
>>PropertyChangeListeners and updates its _foreignTableName-Attribute when
>>the table name changes.
> I can see what you mean, though I probably wouldn't use events for
> this. The major problem is that for parsing from XML it is currently
> necessary to have some duplicated data such as the table names in the
> foreign keys.
> A much better solution would be to retrieve this name of the
> referenced table from the table object directly which would eliminate
> all these problems. Unfortunatley, I havn't had the time yet to
> implement the two-pass parsing algorithm (first only the independent
> items, i.e. the tables/columns, and then the depending items, e.g.
> foreign keys, indexes) necessary for this.
> Tom

View raw message