UvMoney Back to XML

322 words.

Note: This has been sitting in my drafts for months.

I previously wrote that I was switching to a database backend for UvMoney. I’m not doing that anymore. :)

As I was adding in the database implementation, I started to realize that I was putting in a lot of work and adding some project dependencies for a negligable return. I also realized that I trusted the XML code completely, but I didn’t trust the new database code at all, and I just couldn’t bring myself to “flip the switch” and remove the XML functionality. (After all, this application is “in production” in the sense that I have used it daily for my household finances for almost a year now — I sure don’t want to lose that data.)

So I re-thought my strategy. Instead of abandoning the XML files, I’ve decided to revise them to support the functionality that the database would have given me.

My original XML file design revolved around what I call “Transactions.” In UvMoney, a Transaction is a balanced collection of two or more credits and debits, each of which I call a “Line Item.” This is standard accounting stuff. The total of the credits in the transaction must equal the total of the debits, blah blah, etc. etc. Originally, I envisioned the Transaction as the central data structure.

However, while implementing the database, I found that it’s much easier to work with the data when the Line Items are the central data structure. Making that change required a slight change in the XML structure, namely moving some pieces of data from the Transaction level to the Line Item level.

Now that I’ve made that change, I can do everything I want with the XML files.

The only lingering question is concurrency. Obviously I can’t allow two people to write to the XML file at the same time, so I’ll have to implement some kind of locking scheme.

Related

This page is a static archival copy of what was originally a WordPress post. It was converted from HTML to Markdown format before being built by Hugo. There may be formatting problems that I haven't addressed yet. There may be problems with missing or mangled images that I haven't fixed yet. There may have been comments on the original post, which I have archived, but I haven't quite worked out how to show them on the new site.

Sorry, new comments are disabled on older posts. This helps reduce spam. Active commenting almost always occurs within a day or two of new posts.