UML Model for Gnc-Engine

John Ralls jralls at ceridwen.us
Thu Apr 14 16:10:40 EDT 2011


I've finished (for now) the object model. It now incorporates the engine and Qof. You can download it from [1], and I've made a diagram showing class inheritance and associations, which you can get at [2] (png) or [3] (svg). I wanted to put the diagram in the wiki, but uploads, and hence (AFAICT from the MediaWiki docs) images aren't enabled.

The model doesn't reflect all of the relationships in the code, just the ones that GObject-Introspection captures and which are then translatable to UML. GObject-Introspection isn't really a modelling language; it's intended to make it easy to write language bindings. It also doesn't work particularly well with anything that isn't GObject-derived, and unfortunately only a small part of Qof is.

Another oddity you'll notice in the class diagram is that the association arrows appear to point the wrong way, and they're not aggregations. This is a reflection of the query-oriented architecture. For example, Price has a Commodity field rather than the other way around because Price is (to use RDB terms) a table with tuples for all of the prices; which ones belong to which commodity is represented by a field in the Price tuple. The normal OO way to represent this would be an array of Prices in the Commodity class, represented by an aggregation association from the Commodity class to the Price class.

[1] https://github.com/jralls/gnucash/raw/introspection/GncEngine.xmi
[2] https://github.com/downloads/jralls/gnucash/GncEngine.png
[3] https://github.com/downloads/jralls/gnucash/GncEngine.svg

Now to figure out and diagram all of the ways we use KVP slots so I can finish up the long-promised ERD.

Regards,
John Ralls


More information about the gnucash-devel mailing list