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!
Neat, the joda-money site says that version 0.5 was release on 17th Nov 2008 though.. typo one suspects.
ReplyDeleteHi Tom,
ReplyDeleteI love your interface "BigMoneyProvider", it's just more than cool!
Cheers,
Danny
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.
ReplyDeletethis in your pom file:
ReplyDeleteC:\java\jdk1.5.0\bin\javac
doesn't seem right.
two CurrencyUnits could compareTo --> 0 and not be equals().
ReplyDeletethere -- i know it stinks to have no known bugs :)
ah, they're 'singleton's so to speak, so i guess == works. never mind then. back to 0. :)
ReplyDeleteA "Getting started" page would be most welcome :)
ReplyDeleteI 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@mebigfatguy - don't know how to remove the C: path from maven I'm afraid.
ReplyDelete@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
@Danny
ReplyDeleteI 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.
Hi,
ReplyDeleteThis 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 ;)
Actually, I just came across your earlier post concerning Joda-Money, and there already were some discussion of Time&Money in the comments.
ReplyDeleteLink 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
I don't understand what the MoneyPrinter interface is for. Is it connected to MoneyFormatter?
ReplyDeleteMoneyPrinter is the low level interface within the formatting system. It allows anyone to plugin their own printer.
ReplyDelete