Tuesday, 17 November 2009

Joda-Money 0.5

I've just released v0.5 of Joda-Money. It is a simple money and currency package along the lines of Joda-Time.

Joda-Money 0.5

Joda-Money is a project to provide a small, focussed monetary library for Java, similar to Joda-Time. I released v0.5 this morning.

Website, Javadoc, Download, Maven 2 repo

The code is all tested and there are no known bugs. But I wouldn't suggest using it in production code quite yet. I do want lots of feedback and testing though! So, all feedback is welcomed, here, the forum or the list.

The main API is as I originally intended. There is a Money and BigMoney class, the former decorates the latter to restrict the number of decimal places to the currency scale.

There is also CurrencyUnit and a provided data file of currency data. Finally, there is printing (but not parsing yet).

The goal of the library remains just these basic classes. Financial calculations (for whatever domain) or classes storing specific concepts like gross/net/tax are out of scope for the library.

This release is part of the 'release early' approach. Please provide as much feedback as you can!

14 comments:

  1. Neat, the joda-money site says that version 0.5 was release on 17th Nov 2008 though.. typo one suspects.

    ReplyDelete
  2. Hi Tom,

    I love your interface "BigMoneyProvider", it's just more than cool!

    Cheers,

    Danny

    ReplyDelete
  3. in order for a money api to be really useful, in the cases i've seen at least, there needs to be a time element to the money as well. This 20 dollars was on june 15, 2004. As that's important when contracts, and exchange rates are involved.

    ReplyDelete
  4. this in your pom file:

    C:\java\jdk1.5.0\bin\javac

    doesn't seem right.

    ReplyDelete
  5. two CurrencyUnits could compareTo --> 0 and not be equals().

    there -- i know it stinks to have no known bugs :)

    ReplyDelete
  6. ah, they're 'singleton's so to speak, so i guess == works. never mind then. back to 0. :)

    ReplyDelete
  7. A "Getting started" page would be most welcome :)

    ReplyDelete
  8. I wonder if providing methods which accept 'double' parameters in a library is a good idea? Aren't they are always endangered to be affected by rounding errors?

    ReplyDelete
  9. Stephen Colebourne19 November 2009 at 07:56

    @mebigfatguy - don't know how to remove the C: path from maven I'm afraid.

    @kutzi - the double methods are carefully javadocced as to how they handle rounding, and how they work. They make code a lot more readable in the absence of BigDecimal literals.

    @Ignacio - yep, a user guide would be useful, although its a pretty small API!

    @Tom, thanks for the spot

    ReplyDelete
  10. Artur Biesiadowski19 November 2009 at 16:50

    @Danny
    I don't think the main goal here is to support financial/investment banking applications. There are way too many complications in each possible market to manage it with simple api. I would rather consider web shop kind of apps - where you want to be sure that you are displaying correct sum depending on what country the client is ordering from.

    ReplyDelete
  11. Hi,

    This is great news!

    When I was searching for a Money library, I remember coming across Time & Money ( http://timeandmoney.sourceforge.net/ ), which was developed by Eric Evans and other DDD practitioners.

    While the project is still in Alpha status and does not seem to be actively maintained, I think you could take some ideas from what they did there.

    Seeing the quality of Joda Time, I am sure this Money library will be great ;)

    ReplyDelete
  12. Actually, I just came across your earlier post concerning Joda-Money, and there already were some discussion of Time&Money in the comments.

    Link to the earlier post for those who missed it (like I did) and are interested in the previous discussions:
    http://www.jroller.com/scolebourne/entry/joda_money

    ReplyDelete
  13. I don't understand what the MoneyPrinter interface is for. Is it connected to MoneyFormatter?

    ReplyDelete
  14. Stephen Colebourne29 November 2009 at 19:49

    MoneyPrinter is the low level interface within the formatting system. It allows anyone to plugin their own printer.

    ReplyDelete