This project is an effort to create a collection of immutable, thread-safe, highly concurrent, common domain model classes and associated formatters and taglibs, first in the Java language and eventually in other programming languages.
In this age of multi-thread programming and the trend towards massive multi-core computing, thread-safety, immutability, and synchronization / lock contention become critical concerns. Many popular older technologies fail miserably in these regards.
Fundamental Types classes are all immutable and thread-safe, allowing them to be safely shared across many threads.
Fundamental Types classes are as lock-free as possible to avoid the performance killer of lock contention between threads.
Aggressively caching a high-transaction system can help optimize performance and enhance availability. Because the classes of Fundamental Types are immutable and thread-safe, they are all appropriate to add to a cache.
Human affairs are messy, subjective, and ever-changing. Localization data, in striving to model this messiness, must necessarily make judgement calls that may not be appropriate for all situations. No matter how correct localization data is today, tomorrow a country may change its currency (e.g. Euro transition), its daylight savings time dates, or even cease to exist. Fundamental Types therefore aims to provide the flexibility to plug-in any localization data at system start-up time, though the project currently falls short where classes use only CLDR or JDK localization data.
Responsibilities are clearly separated between layers. Domain models are complete yet minimal. Domain models are agnostic of locale. Formatters drive behavior from little more than the locale and the domain model instance being formatted.
This project does not waste effort to replace technologies that already achieve the goals outlined here, but may extend those technologies and wrap them in certain cases. Fundamental Types builds functionality on top of the JDK, Joda-time, International Components for Unicode (ICU), and the Units JSR JScience reference implementation.
Methods follow the fluent interface conventions appropriate for immutable classes. See:
Martin Fowler's fluent interface article
Stephen Colebourne's blog post on immutable pojos
Unit tests help ensure quality and therefore this project aims to maintain at least 95% line and branch coverage.
The roots of Fundamental Types are from a high-transaction web travel commerce platform that powers Orbitz Worldwide storefronts. Therefore, when a design tradoff is made, there is an inherent design bias optimized towards the server side. Very different types of applications may or may not find this project appropriate.
It is our hope that this project will be harvested into other projects; perhaps portions of it will become redundant as those parts are folded into the JDK, Joda-time, or ICU.