ObjectLabKit 1.0.1: Date Calculators for Business and Finance


News: ObjectLabKit 1.0.1: Date Calculators for Business and Finance

  1. ObjectLab has announced the release of version 1.0.1 of ObjectLab Kit for Java 1.5, available for download via SourceForge or the Maven Central Repository. The Kit provides Date Calculators and comes in two versions: one based on pure JDK (1.5) and one based on the Joda-time library (1.3+, JDK 1.5). The library is live in a UK & international Bank in the Credit Derivatives department. The DateCalculator implementation is intended for any business, while the other two interfaces are more specific to the financial industry. The most common function of a lot of banking or business applications is the handling of holidays and weekends; a set of standard rules are implemented to deal with days falling on a holiday. The library concentrates of the date manipulation and calculations. ObjectLab Kit provides the implementation of three interfaces:
    • DateCalculator for all date calculation and handling of weekends or holidays
    • PeriodCountCalculator for calculating differences between two dates in days, months or years according to some financial algorithms
    • IMMDateCalculator to calculate the International Money Market dates
    ObjectLab has used and participated in several open source projects. ObjectLab is also sponsoring QALab, a tool that keeps track over time of the static analysis results from FindBugs, Checkstyle, PMD, Cobertura, etc. ObjectLab is released under the Apache License. What do you think of this latest release of the ObjectLab Kit? Would you think of this as a step toward moving open source up the stack toward business functionalities in the financial industry?
  2. joda time[ Go to top ]

    http://joda-time.sourceforge.net/ I see that ObjectLabKit can interface with JodaTime but I don't quite understand what it adds... is it just UK specific formulas? JodaTime itself is great for date calculations.
  3. Hi KC, Thanks for your comments. The ObjectLab Kit provides 2 implementations of a set of functionalities that are used very commonly by businesses and financial institutions. These algorithms are generic and international. One implementation is pure JDK and has no equivalent under similar licenses, we believe. The other implementation makes uses of the excellent Joda-time library. The interface stays the same between the 2 implementations, if you learn one way, you'll know the other way. The Joda library provides a lot of functionality but not the ability to roll-over calculated dates that fall on a holiday, like we do in the financial world: forward, backward, modified following and modified preceeding. See this page for some info on those algorithms: http://objectlabkit.sourceforge.net/algo.html Furthermore, the idea is to be able to combine holiday calendars, say if you trade 2 currencies you may have to take into account the holidays in the settlement market of both. Creating all combinations of such calendars is not feasible (or advisable) up-front, the ability to combine them is useful. We also handle Tenor codes, like Overnight, Spot, 1D, 2M, 5Y, etc which has some business logic (basic but how many times re-written and re-tested). Refer to this page for more info: http://objectlabkit.sourceforge.net/tenor.html We also offer a simple IMM date calculators and a useful way to access those dates (like get next IMM date, get the list of IMM dates between d1 and d2, etc) Finally calculating the period difference between 2 days in terms of say days is obvious but in terms of months or years can lead to some interesting and more complex results according to the convention used for a particular instrument. In conclusion, the Date calculators are probably useful to any business that needs to deal with holidays. IMMDateCalculator and PeriodCountCalculators are more useful for the financial industry. It is a simple library, but it is neat and tidy and it does what it says on the tin... Kind regards Benoit
  4. thank you for the excellent explanation. it would be great to see this type of functionality rolled up into a joda 2.0. (and of course, not 1.5 dependent-- most 'enterprises' are very conservative)
  5. 1.5 or not...[ Go to top ]

    Hi 1.5-or-not-1.5... We thought about it quite a lot... but we have seen quite a few banks switching to 1.5; we found that the use of generics would simplify our interface and allow us to create a 'generic' one (pun semi-intended) that you would then specialise for Date, Calendar, joda.LocalDate or joda.YearMonthDay. What we found quite interesting was the fact that we were able to define the units tests in terms of generics and hence ensure the same level of testing regardless of the actual implementation. Creating the same full suite of unit tests for a new implementation was a matter of 5-10 lines...for thousand of tests. We went down the route of generics instead of defining our own 'date-functionality' wrapper which was an option; we felt that as soon as we would come up with YAWFD (yet-another-wrapper-for-date) people would turn away. Generics are good for these! If one desperately need our library (look in my eyes, look in my eyes, you neeeeeed ObjectLab Kit!) but still uses 1.4 or so, I'd suggest to look at http://retrotranslator.sourceforge.net/ as mean to retrofit the byte code to run under 1.4 Finally we initially thought of simply providing an extension/contribution to Joda but the initial feedback from joda was mixed and, the bank was not too sure about using Joda at that time, so that dependency could have been an issue if it was mandatory. Now, we have the best of both worlds, but we do recommend Joda-time as it would probably help you outside the ObjectLab Kit anyway! :-) I hope this helps. Benoit. PS: we also launched another open source project on a very different subject, QALab, see: http://qalab.sourceforge.net
  6. Looks nice. I'll definitely take a look.
  7. feedback welcomed[ Go to top ]

    Hi Roy, Thanks for your comment. Do not hesitate to contact us if you have a feedback. We had an interesting email exchange with Paul H. who suggested that the calculator enforces a "valid range", i.e. throws an exception if the calculated date falls outside a given holiday Set (+ min and max boundaries, e.g. Jan 1 2006 and Dec 31 2006 for 2006, even if the last holidays is Boxing Day). Do people require this? regards Benoit.
  8. Re: feedback welcomed[ Go to top ]

    Rory... not Roy, typo. sorry.
  9. Hello Benoit I have the job to calculate a period based on a calendar. The period should only take business days into account. Means I have to exclude weekends and holidays. I'm trying to use the objectlabs kit based on joda time. As far as I can see the PeriodCalculator only excludes the weekends. How can I exclude the holidays as well? Is this supported? I saw that the LocalDateCalculator is taking care of holidays but I didn't found out yet how to easily calculate a duration with it. Thank you very much for a tip. Best regards Alan