I have a hobby programming project that has been mothballing until about a fortnight ago, when I decided to risk trying pushing some new functionality out.
I call it PersonalFinancier, and it’s hosted on GitHub under an open-source licence.
Since finishing the budgeting functionality, the itch to push the functionality out pretty-much stopped. I’d answered my cash-flow concerns, and was once again in that pleasing place of being certain that it was alll ticking over quite happily without my needing to watch it closely.
Lately, I’ve been itching to answer a new financial question that ultimately needs me to compare monetary values across over a decade of elapsed time. Now… I could just have visited the ABS, and used their inflation calculator, but where’s the fun in that? I’d written something very similar way back in the early 2000s when I was first cutting my teeth on Java, and frankly, looking at that code now is pretty painful. I decided to nuke it from orbit, because let’s face it… it’s the only way to be sure!
Tonight, I pushed the last commit up to GitHub that implements my Inflation Calculator. Though the calculator looks similar to the original in terms of its user-interface, the guts of it was a complete rewrite.
This flash new calculator involves two separate inflation models. The base model captures and manages CPI figures published by the ABS (or if you care for some serious scenario planning, a completely fictitious set). The second model is devoted to the calculator itself, and acts as one of the MVC viewers to the base model, the other viewer being the table widget used to render the CPI figures.
It also takes a “favour composition over inheritence” approach to constructing the GUI. Inheritance of GUI components is a weakness that I’ve been known to fall into in the past, so this build has been a deliberate attempt to construct a rich GUI experience without defaulting to a deep nested inheritance structure for my tweaked Swing widgets.
In fact… here’s a link to the CPI figures as a JSON encoding. Building a POJO to match I leave as exercise to the reader. No promises I’ll keep it up to date unless someone reminds me that I’ve let it get stale.
Next step… putting a pretty graph into that unused panel. Here’s to the kids keep up their disinterest in my nightly itch-scratching.