Diagnose

Robert Brenstein rjb at robelko.com
Tue Oct 5 16:52:39 CDT 2004


>On 10/5/04 3:49 PM, "jda" <jda at his.com> wrote:
>
>>  Hi Ruslan,
>>
>>  You asked me to move this to the betas list, so here it is.
>>
>>  Once 2.0 is stable/released, I think a developer-oriented diagnose
>>  would be very useful. As I imagine it, it would return a string (or
>>  object) containing the results of the diagnose, so that the developer
>>  can present his own report to the user.
>>
>>  Obviously, the diagnose string/object would not return everything
>>  that checked out OK, but only the things that were problems, e.g.
>>
>>  diagnose.errorCount
>>  diagnose.errorNum(i)
>>  diagnose.errorString(i)
>>
>>  If there is, for example, an index error, we could simple repair the
>>  index for the user automatically. If the problems were more serious,
>>  such as a corrupted table, we could offer to rebuild the database by
>>  dump/import.
>
>Good idea!

IMHO, open database should first check the integrity flag. If it is 
okay, it should go ahead and open the db. If not, it should return an 
error that db was not closed properly. Then, we decide whether to run 
diagnose (and act upon the results) or ask to open it anyway as it 
is. I would not like to have this occuring automatically (just like I 
always hated Valentina changing file format on me silently).

Diagnose should have options telling it what exactly to do and what 
to report. In some programs, I may want to have only errors reported, 
but in others, I may want all good and bad. The results should 
probably be a single report string, although, may be in highly OO 
environments using objects would be preferable.

The single-string report could be returned as XML, so we could parse 
it to extract individual information we need. Most environments have 
xml parsing libraries available after all.

>
>>  We could run the diagnose every time a db is opened, too, to catch
>>  corruption errors early and warn our users before they become
>>  compounded and result in trashed databases (which does occasionally
>>  happen).
>>
>>  What do you think?
>
>Hi Jon,
>
>I think String is not a problem.
>
>Than more that internally we do build it as string originally...
>
>I think we can add API functions
>
>     db.Diagnose()
>
>And yes, it is interesting idea to use object for this.
>Of course it will require many changes in the current code...
>Ech, could not you tell this 2-3 months ago. :-)


But, Ruslan, this is really not a new idea. It has been discussed at 
least a few times in the past. Sometimes I have a feeling that you do 
not have a proper system tracking feature/bug requests. May be you 
should consider something like Bugzilla (not that I would truly 
recommend this specific product) for version 2.


>I think for 2.0 we need at least Diagnose() as string.
>

Robert


More information about the Valentina-beta mailing list