Jadira is the home for Sousan and Chris Pheby's open source projects. These are reusable open source Java modules that provide first class solutions using the most effective current JEE technologies.

Tag Cloud

Approach for Adding Joda Money Support to Jadira Usertype

For the next release of Jadira Usertype I am planning to add support for Joda Money.

The changes proposed are shown in this article. The existing column mapper framework used in Jadira Usertype will be augmented to provide new base mappers for Integer and Decimal types, and concrete mappers provided to map CurrencyUnit, Currency and BigMoneyProviders to single columns. For BigMoneyProvider types, Major (e.g. dollars), Minor (e.g. cents) and Decimal (i.e. dollars and cents) mappings will be provided:


These mappers will be used to implement single and multi-column types that support a variety of ways of storing money both with, and without a separate column for holding the currency:

Please share any feedback or suggestions for the proposed design.


New Answers for New Questions: (More Than) A Decade On

Back in 2000, as part of my dissertation, the subject I wrote on was the concept of how electronic publishing was changing media and literature. Well, I didn't coin the term blogging or social network, but reading it now is fascinating. The question I posed was:

"One of the key social and philosophical issues confronting society in the beginning of
the 21st century is the sharing of all kinds of information. How we react to this issue will
change the very nature of the creation and distribution of literature, which is just one form
of information, albeit information with very special properties. Textual media and our
notion of it are changing. Old methods of sustainability and funding in publishing (literally
sales of printed material) are no longer so assured. As literature adapts to the new medium,
the nature of the material being published will be altered forever, as will the mechanisms
and organisations that support publication. The purpose of this paper is to examine the
likely nature of the impact of new media on literary publishing."

I concluded:

"It is clear that the major impact that electronic publishing is having on literature derives from its immediacy, its flexibility and its interoperability. The activities of the underground art scene with their emphasis on anonymity, and implicit and advanced understanding of practical methods of exploiting intellectual property in the digital medium means that the relations between privacy, speech, academic freedom and accountability must be an intrinsic part of any system of quality assessment and validation online. Indeed, experience shows that where a publication or public (broadcast) communication environment does not make such features an intrinsic aspect of the communication, the noise will invariably rapidly begin to outweigh the useful content.

The issues surrounding copyright, academic freedom, the right to privacy, and freedom of speech are provocative, and practical conclusions seem to challenge accepted normalities. These issues can only be effectively addressed in the context of a thorough understanding of the digital environment itself.

The electronic environment will force us to reassess our notion of intellectual property, and publishers, academics and critics will have to reassess their roles of they want to continue to provide value in the electronic environment. If the Internet and Electronic Publishing are to fulfil their promise of an interoperable, searchable canvas –the world’s biggest library, in which all creators can play their deserved part, such review should be the product of an open-minded and informed public debate; one that interested contributing members of literary communities should not only witness but also be at the centre of..."

The University gave dispensation allowing me to publish this paper on my personal website. It is available to download from here.


Where Next for Jadira Usertype?

Its getting close to two years since I first put together the Usertype library. The project - quite a small piece of open source - began when I wanted to put together some classes for integrating the ThreeTen library (the reference implementation for JSR310) and Hibernate. The library expanded to support Joda Time almost by accident. I was using Joda Time Hibernate to verify that the JSR 310 mappings worked - writing to the database using one library and reading back to the other - when I found inconsistencies between the two libraries. Digging into the causes revealed problems with mapping of types such as LocalTime that had their roots in the way JDBC handles temporal types.

Today Usertype not only addresses these issues but also has support for arbitrary configuration of the database and jvm timezone; a wide variety of single and multiple column types and the JPA @Version annotation. The pending release will allow for global configuration using Hibernate properties and autoregisters the most common type mappings - avoiding the need to register them in Hibernate configuration or via annotations. Usertype supports both Joda Time and JSR 310 giving a convenient migration route from one library to the other. The library is proving remarkably stable, with very few defects and I encourage any users of the original contributed Hibernate library to consider using it.

I am now wondering where future development for the project should lie. The likely next step will be for the project to incorporate support for other fundamental types. Like date and time types, money types share many of the same properties - strong typing, single and multiple column mappings and other needs. The recent announcement of JSR 354 - Money and Currency API has me considering adding support for this API as it becomes established, and as with Joda Time, I plan to create a forward looking bridge by including support for Joda Money. The second direction I am considering taking the project is in supporting JAXB bindings for the various supported types. This will again help provide a forward direction for each supported datatype and help to put in place a canonical representation for the important Money and Currency types. The exact form these data-bindings will take needs more consideration, and should reference the general structure used in standard financial formats such as ISO 20022. Feedback on the planned directions is very much appreciated.

Closely related to Usertype is the Jadira Bindings project. This project provides a set of data binding APIs that support implicit conversions from one data type to another. The project is now becoming increasingly mature and is being enhanced to support registration of any kind of function - not only for conversions. During the next few months I expect to deliver a 1.0 release. There are also some other projects I am preparing code for - also planned to be open source - but I want to save discussion of these for another post.


Solution Development Lifecycle

The last article focused on the importance of having an architecture vitality process. This article expands the single element of that diagram labelled 'Solution Participation'.

Organisations should seek to find a rapproachment in their software development lifecycles between having no organisational process and being overly prescriptive, forcing teams to fit to an organisational process that leaves no room for innovation in working practice.

My own experience is that at the organisational level, a process loosely based on RUP - iterative, with shifting emphasis of application of varying disciplines as the iterations proceed - can support a wide variety of methods. Typically the organisation needs to specify compliance checkpoints - around acceptance of requirements, review of inception and construction architectures, and delivery to test. This can result in needing to make minor adaptations to the use of agile methods to accommodate compliance and traceability needs; in practice this is not a deal breaker for agile.

Below I have modelled how the use of Feature Driven Development can be used to realise such a solution delivery process - a project management approach which I find to be especially relevant for looking after shared enterprise components and services.


Architecture Vitality

In my last article I described a set of simple steps that begin the establishment of architecture. This article has a different focus - architecture vitality. Architecture vitality describes the (mostly informal) process by which new busines strategies and requirements (demands) are incorporated into the organisation. Through this process the architecture is enhanced and updated to facilitate their fulfilment, bringing in new solutions technologies and designs. These project developments need incorporation into the enterprise architecture - and the architecture governance process also needs to ensure that project innovations are appropriate and suitable for the enterprise architecture context.

Vitality is an active engagement process, but is not concerned specifically with the design and delivery of solutions in itself.