<price currency="USD">34.52</price>
In this case, if I wanted to convert the same price into pounds sterling, it's not in fact a straightforward fixed conversion rate, but will depend upon multiple factors - the date that the transaction took place, any conversion charges that may apply and so forth.
<price currency="USD">34.52</price>
<price currency="UKP">18.32</price>
If this is in fact recording a transaction, and the conversion rate is not in fact discoverable (and that's perhaps the biggest issue here) the idea of incorporating the units into the instance makes sense - the transaction costs involved in discovering the equivalences are higher than the cost of carrying the data in the first place. To me that should be the bigger decision determinant when talking about replication of information - is the cost of replication less than the cost of computation when the data is re-referenced.
I've seen that recently on specific MarkLogic projects. Certain information was in fact derivable from other information, but the derivation costs were pretty dramatic and couldn't be indexable. In that particular case, it made more sense to derive the relevant values and store them with the calling data as a key, even though such a field meant that the dataset was not formally normalized.
Of course, what this means in practice is that there really is no best practice with regards to units and conversions; it depends upon your requirements as to whether you derive or replicate.
Kurt Cagle
Invited Expert, XForms Working Group, W3C
Managing Editor, XMLToday.org
On Sat, Apr 9, 2011 at 3:57 PM, John Cowan
<cowan@mercury.ccil.org> wrote:
Amelia A Lewis scripsit:
> Or, to quote the storied wisdom of the ancients: a man with one clock
> always knows what time it is. A man with two is never sure.
There's an opposite point of view, though: "Sure, what would we be wanting
with two clocks if they both told the same time?"
--
Kill Gorgun! Kill orc-folk! John Cowan
No other words please Wild Men. cowan@ccil.org
Drive away bad air and darkness http://www.ccil.org/~cowan
with bright iron! --Ghan-buri-Ghan http://www.ccil.org/~cowan