It is not a coincidence that there is a new release of NMoneys around the New Year.
Countries usually take advantage of this hard change to perform drastic changes in their monetary systems and so it is up to NMoneys to catch up with reality.
This year, however, there is so much more...
The usual End-Of-Year changes
This years' changes in currencies came from the amendments 164: introducing STD
instead of STN
to the people of Sao Tome and Principe; and 165: introducing MRO
instead of MRU
to the people of Mauritania.
The unusual breaking change
I mentioned in my last post that I ran a copy of NDepend on some of my codebases.
NMoneys is one of those codebases.
It came with some interesting suggestions which I implemented, but vast majority of them were internal.
There is one, however, that is not.
The suggestion came from the fact that there was a "mutual dependency" between members of the namespace NMoneys
and the members of the namespace NMoneys.Allocations
. That dependency comes from the fact that the .Allocate()
methods (declared in NMoneys
) take a list of arguments declared in NMoneys.Allocations
and those types make use of members of the NMoneys
namespace.
This can be seen as a circular dependency. It would, in fact, be if the namespaces turned into assemblies (definitely no plans on making that change). And I took the decision to break such dependency at the cost of a breaking change.
The steps to unbreak are simple: recompile your code against the new version if you use any of the .Allocate()
methods and you are good to go. I plan a new post going deeper into why is that necessary.
The very minor
There is a new extension method over CurrencyIsoCode
enumerations to efficiently compare against another enumeration.
Impact internal housekeeping
There is a project within NMoneys that is used internally: NMoneys.Tools
.
This project provide a command line interface to inspect and compare NMoneys's implementation against two of the "authoritative" sources: the iso.org website and the System.Globalization namespace.
The code for the tool kind of worked but did not receive a lot of love and it was becoming an annoyance. So I decided to give it a facelift.
The consequences of the facelift is that from now on it would be easier to analyse the changes to be made to NMoneys to improve its accuracy.
As a matter of fact it has made my life much easier to reconcile a lot of information with System.Globalization, since they have done a great job to support many more cultures and currencies.
The complete list is in the changelog.
Words are cheap
And they usually don't compile.
So head up to Nuget to fetch the latest version and enjoy the upgrade!