Budgets and inconsistent handling of account sign reversal.

Christian Stimming stimming at tuhh.de
Tue Feb 23 15:44:08 EST 2010


Am Montag, 22. Februar 2010 schrieb Jeff Kletsky:
> The addition of a way of denoting the "default budget" should be
> reasonably easy.

You can always add kvp_frame entries at some of gnucash's top-level objects, 
like the Book, Account, Transaction, or Split. See e.g. the Notes field of an 
Account in xaccAccountSetNotes / xaccAccountGetNotes in engine/Account.c.

The kvp data is transparently read and written again by all earlier versions. 
At least for XML, this is currently our most efficient solution when adding 
new fields without breaking backwards compatiblity.

> (As a side note, it becomes "rather challenging" to maintain backwards
> compatibility when the backend is a database, especially if any columns
> change or are deleted.)
> 
> How far back should I be confirming compatibility? 2.2.9? 2.2.0? Before?

As Derek said, something around 2.2.5 should be fine; theoretically 2.2.0 
would be the requirement, but this is already way too old.

> Is there supposed to be guaranteed backward compatibility for anything
> but the XML backend?

As Derek said: The previous stable series 2.2.x only had XML backend, so the 
new backends don't have to be backwards compatible to anything. It would be a 
good time to build in some functionality to offer such a guarantee in the 
future, though...

> Does the XML backend "gracefully ignore" tags that it doesn't
> understand? For example, if a "default budget" field is added to the
> book, is it "skipped over" on read if there isn't a corresponding data
> field for its contents to populate?

No, because if it were ignored on Load, on the next "Save" the data would be 
lost.

> Can I assume that "backwards compatibility" allows for data that was
> created in a later version, that did not exist in an earlier version,
> not to "magically" be preserved if the user then moves forward in
> version? For example, if 2.4.x adds "default budget" then the saves as
> XML, opens in 2.2.9 (where the field does not exist), saves from 2.2.9,
> then opens in 2.4.x, then the value of "default budget" would likely be
> lost.

That is exactly the problem if the XML schema would be modified. Kvp solves 
this problem (for XML).

Regards,

Christian


More information about the gnucash-devel mailing list