I like the new implementation, especially the fact that I can select which implementations I want to check (those settings should be saved in the project though). And the error badge at the columns is quite nice.
However some things are not yet working as expected ;)
I just ran it on a very simple model, and I the following entry:
"ERROR","birthday: DATE","Generic","Physical name not legal for"
I don't understand why the name is marked as an error. "birthday" should match the Regex defined in AlphaNumericNameCritic as far as I can tell.
And the message is not very nice either because it's not a complete sentence.
If a Generic critic is enabled, as well as the DBMS specific version (e.g. AlphaNumericNameCritic and OraclePhysicalNameCritic I think the Generic one should be disabled (or ignored). I guess the easiest solution would be to allow selecting individual critics in the Critic Manager window. The more sophisticated solution would be to check the inheritance tree, and disable all ancestors of an enabled critic.
The error messages should ideally go into a ResourceBundle.
I don't think users that chose to run PA in their native language would like to see english error messages ;)
If you want, I can take care of that (English and German)
And finally there is an error that I don't understand at all:
"ERROR","film_id - film_title.film_id","Generic","Physical name not legal for Column Mapping"
What does this tell me? I tried to find the place where this is generated, but couldn't spot it.
Cheers
Thomas
> There is an existing bug that creating new columns has the physical
> name set to the empty string. It would make much more sense to have
> the physical name match the logical name unless a user changes it.
> This sentence ends up becoming unreadable when the physical name is
> empty because it is trying to say "Physical name is not legal for the
> column with the physical name (empty string)". It would read better if
> it was changed to something like "Physical name is not legal for the
> column with the logical name (birthday)." or something similar.
Yes indeed that was the problem. After adding a physical name, the error went away.
I changed PhysicalNameCritic to detect that situation and return a proper error message.
Even if the bug for new columns was fixed, the user could still accidently delete the physical name, so I think it makes sense to show that in the critic.
> As a side note, to help find the critics that an error is about you
> can click on the row in the table and it will select the object the
> critic is on in the play pen.
Yes, I noticed that. Very nice!
> At current you can disable a critic in the critic manager by changing
> its error type to "Ignore". For this specific case you can set the
> generic critic to be ignored and the DBMS one to be something else.
Ah, I didn't checkt the dropdown, sorry.
> One limitation to the inheritance tree idea would be if you have two
> critics that criticized different aspects of an object but extended
> the same class. For example, if you had a generic critic that forced
> all names to be only alpha-numeric and a platform specific critic that
> limited the name length but not the characters you would want to have
> both critics on at the same time. Maybe we can introduce a type of
> hierarchy in a different way in the future.
Yes, good point.
> I think this is a mistake on what the critics are identifying as
> illegal names. In the SQLRelationship class you will see the class has
> children of type ColumnMapping. A column mapping is an object that
> points to two columns, one in the pk table and one in the fk table, of
> a SQLRelationship. The error says that the physical name is not legal
> but it should not matter because it doesn't actually get used in a
> database.
So wouldn't it make sense to skip ColumnMapping objects in the PhysicalNameCritic
Regards
Thomas