672329 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 8 Messages: 8 Messages: 8 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

ObjectLabKit 1.0.1: Date Calculators for Business and Finance

Posted by: Benoit Xhenseval on October 11, 2006 DIGG
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?

Threaded replies

·  ObjectLabKit 1.0.1: Date Calculators for Business and Finance by Benoit Xhenseval on Wed Oct 11 14:33:42 EDT 2006
  ·  joda time by K S on Wed Oct 11 16:29:34 EDT 2006
    ·  not UK specific, provide some business functionality JDK or Joda by Benoit Xhenseval on Wed Oct 11 18:39:29 EDT 2006
      ·  Re: not UK specific, provide some business functionality JDK or by K S on Wed Oct 11 18:53:21 EDT 2006
        ·  1.5 or not... by Benoit Xhenseval on Wed Oct 11 19:06:05 EDT 2006
  ·  Re: ObjectLabKit 1.0.1: Date Calculators for Business and Financ by rory Winston on Fri Oct 13 05:22:28 EDT 2006
    ·  feedback welcomed by Benoit Xhenseval on Fri Oct 13 09:32:18 EDT 2006
      ·  Re: feedback welcomed by Benoit Xhenseval on Fri Oct 13 09:32:58 EDT 2006
        ·  PeriodCalculator - how to exclude holidays? by Alan Gross on Mon Jul 06 03:20:20 EDT 2009
  Message #220074 Post reply Post reply Post reply Go to top Go to top Go to top

joda time

Posted by: K S on October 11, 2006 in response to Message #219994
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.

  Message #220081 Post reply Post reply Post reply Go to top Go to top Go to top

not UK specific, provide some business functionality JDK or Joda

Posted by: Benoit Xhenseval on October 11, 2006 in response to Message #220074
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

  Message #220082 Post reply Post reply Post reply Go to top Go to top Go to top

Re: not UK specific, provide some business functionality JDK or

Posted by: K S on October 11, 2006 in response to Message #220081
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)

  Message #220084 Post reply Post reply Post reply Go to top Go to top Go to top

1.5 or not...

Posted by: Benoit Xhenseval on October 11, 2006 in response to Message #220082
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

  Message #220242 Post reply Post reply Post reply Go to top Go to top Go to top

Re: ObjectLabKit 1.0.1: Date Calculators for Business and Financ

Posted by: rory Winston on October 13, 2006 in response to Message #219994
Looks nice. I'll definitely take a look.

  Message #220265 Post reply Post reply Post reply Go to top Go to top Go to top

feedback welcomed

Posted by: Benoit Xhenseval on October 13, 2006 in response to Message #220242
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.

  Message #220266 Post reply Post reply Post reply Go to top Go to top Go to top

Re: feedback welcomed

Posted by: Benoit Xhenseval on October 13, 2006 in response to Message #220265
Rory... not Roy, typo. sorry.

  Message #310688 Post reply Post reply Post reply Go to top Go to top Go to top

PeriodCalculator - how to exclude holidays?

Posted by: Alan Gross on July 06, 2009 in response to Message #220266
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

New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com

Dependency Injection in Java EE 6 - Part 2

Reza Rahman continues to explore the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (January 21, Article)

Ted Neward Q&A: What you must know about JavaScript, Scala and more

Ted Neward is an independent consultant specializing in high-scale enterprise systems, and an authority in Java and .NET technologies. He is the author and co-author of several books, including Effective Enterprise Java. At TheServerSide Java Symposium in March, he will be presenting sessions on pragmatic architecture, ECMAScript and Scala. (January 15, Article)

Developers split on open sourcing Java

Now that Oracle is absorbing Sun Microsystems, there mixed views on what should come of the Java Community Process (JCP). While some say Oracle should become the new steward of Java and keep the JCP much as it was, others argue that it may be time to open-source this widespread language. (November 24, Article)

Dependency Injection in Java EE 6 - Part 1

Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (November 2, Article)

SAML: It's Not just for Web services

SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options. (September 28, Article)

Programming is Also Teaching Your Team

Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team. (September 22, Article)

Can Java EE Deliver The Asynchronous Web?

Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies. (July 14, Article)

JSF Flex

JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags. (June 29, Article)

The Rules of SOA - A Road to a Successful SOA Implementation

In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project. (June 23, Tech Talk)

Ari Zilka Talks About Terracotta 3.1

Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now. (June 15, Tech Talk)

Enterprise Application Integration, and Spring

In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements. (June 15, Tech Talk)

Google Web Toolkit: An Introduction

In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls. (June 4, Tech Talk)

Just Enough Early Architecture to Guide Development

Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable. (May 28, Tech Talk)

Productive Programmer: On the Lam from the Furniture Police

This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work. (May 26, Tech Talk)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application. (May 19, Article)

Free Book PDF Download: Mastering EJB Third Edition

Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)

Application Server Matrix

The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map