On 05/12/2008, at 12:28 AM, Andrus Adamchik wrote:

Nice. I don't think it is complete to actually use it for the real map validation, but this is a great start.

Well, it validates several maps I throw at it. I haven't compared it to the code, but I did try to generate various maps and couldn't break it. I'm interested if people could try to validate their maps against it and find any breakages.


I guess the immediate value of it is documenting the format for manual editing.

That's certainly helpful.


Now I am wondering where in the model lifecycle during development and runtime would it be appropriate/useful to do automated validation of the mapping? In other words where the benefit of validation would justify the overhead? The map semantical problems are rare, as most people are using the Modeler (that presumably generates a correct mapping).

That may be the case, but if we don't have the modeler check for validity on every save, the schema will not be maintained since there is no incentive to do so and it will fall into disrepair. I'd suggest a validation on every save/open which does not prevent the save/open but shows a dialog if validation is not successful.

I'd suggest this is useful since some people edit the XML by hand (long live 'emacs/vi'!) but still would like Cayenne modeler to validate their schema. It will also provide a second level check that Cayenne modeler isn't outputting rubbish XML under some circumstances (eg. XML which isn't properly encoded or nested incorrectly).


So I can only think of cases that would help us internally, but will not affect the end users:

* Validation as a part of map-saving unit tests
* Switching from manual XML parser to an auto-generated parser based on schema (such as JAXB; although I decided against JAXB some time ago, as it would add yet another hard dependency to Cayenne, and will require a rewrite of a piece of Cayenne that already works well. So I am just using it as an example).


I agree that there is little benefit in this.

Ari



-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001   fax +61 2 9550 4001
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A


Reply via email to