SlideShare a Scribd company logo
1 of 34
JSR 354
Java Money and Currency API


             Werner Keil
    Build Manager, DevOps Expert,
             Agile Coach
             Maersk Line
         EG Member, JSR 354
             @wernerkeil
Werner Keil - Bio
 โ€ข   Consultant โ€“ Coach
 โ€ข   Creative Cosmopolitan
 โ€ข   Open Source Evangelist
 โ€ข   Software Architect
 โ€ข   Java Godfather
 โ€ข   JCP Executive Committee Member
 โ€ข   Eclipse UOMo Project Lead
 โ€ข   DevOps Guy

                                      2
Show me the Money!
Agenda
 โ€ข   History
 โ€ข   Motivation
 โ€ข   The JSR
 โ€ข   Virtual Currencies
 โ€ข   Currency Exchange
 โ€ข   Demos
 โ€ข   Q&A


                          4
History




          5
Earlier Approaches
 Martin Fowler:
 A large proportion of the computers in this world manipulate money, so it's always
 puzzled me that money isn't actually a first class data type in any mainstream
 programming language.The lack of a type causes problems, the most obvious
 surrounding currenciesโ€ฆ




 see http://martinfowler.com/eaaCatalog/money.html
                                                                                      6
Earlier Approaches (2)
 Eric Evans โ€“ Time and Money:
 On project after project, software developers have to reinvent the wheel, creating
 objects for simple recurring concepts such as "money" and "currency". Although
 most languages have a "date" or "time" object, these are rudimentary, and do not
 cover many needs, such as recurring sequences of time, durations of time, or
 intervals of time. โ€ฆ
 see http://timeandmoney.sourceforge.net/
 To be quite frank, their code isnโ€˜t more than an academic POC, factories
 called dollars() or euros() are useless in real globally deployed frameworks,
 but he made a good point.
                                                                                      7
MoneyDance




             8
Motivation
Summary
 โ€ข   This JSR will provide a          money and currency API for Java,
     targeted at all users            of currencies      and monetary
     amounts in Java.
 โ€ข   The API will provide support for standard ISO-4217 and Custom
     (e.g. Virtual) currencies, as well as representation of a monetary amount.

 โ€ข   It willsupport currency arithmetic, even across di๏ฌ€erent currencies, and
     foreign currency exchange.
 โ€ข   Additionally, implementation details surrounding serialization
     and thread safety       are to be considered
                                                                                  10
Why is it needed?
 โ€ข   Monetary values are a key feature to many applications.
 โ€ข   The existing java.util.Currency class is strictly a structure usedfor
     representing ISO-4217 standard currencies.
 โ€ข   No standard value type to represent a monetary amount.
 โ€ข   No support for currency arithmetic or conversion




                                                                             11
Challenges
 โ€ข   Keep it simple โ€“ Remember the most common use case
     โ€ขAdding currency values e.g. in an e-commerce app.
 โ€ข   Performance
     โ€ขHow to support low latency applications, such as High Frequency
      Trading apps.
 โ€ข   Precision
     โ€ขThere can potentially be differing precisions specified for arithmetic,
      currency exchange and formatting

                                                                                12
Challenges (2)
 โ€ข   Formatting
     โ€ขRequirement should be to use existing Number Formats.
     โ€ขHowever there is no existing format representing for example Indian
      Rupees:
      which might look something like this: 12,34,00,000
     โ€ขNatural language support for non-decimal valuations for example
         โ€ข
        Lakhs
         โ€ข
        Crores
         โ€ข
        1 Lakh = 100,000
         โ€ข
        1 Crore = 100 Lakh                                                  13
Challenges (3)
 โ€ข   Formatting
     โ€ข12,34,56,000.21 is written
      12 Crore, 34 Lakh, 56 Thousand Rupees and 21 Paise
 โ€ข   Support for non-standard rounding modes




                                                           14
Non-standard Rounding Modes
 โ€ข   It is a big world, and each country has its regulations and cultural nuances
     for expressing currencies in natural language, rounding policies, groupings,
     etc.
     โ€ข For example, in Argentina rounding is prescribed for the third digit after
       the decimal point:
         If the third digit is 2 or less, change it to 0 or drop it.
         If the third digit is between 3 and 7, change it to 5.
         If the third digit is 8 or more, add one to the second digit and drop the third digit or change it
         to 0.




                                                                                                              15
Non-standard Rounding โ€“ Argentina
 Argentina Rounding Examples

 Original Number   Rounded       Notes
 123.452           123.45        Third digit<3 round down
 123.456           123.455       3<=third digit<=7 change to 5
 123.459           123.46        Third digit>=8 round up



 Switzerland uses a similar rounding strategy.


                                                                 16
Risks
 Plan โ€“ โ€œMoney and Currencyโ€ is a formidable and dynamic category with
 regional dependencies, requiring programmers, business users, international
 accountants, and attorneys.
 Risk โ€“ Incomplete or outdated spec
 Mitigation โ€“ Resulting API should be flexible, let application developer
 change implementation as needed.




                                                                               17
Risks (2)
 Plan โ€“ There is also a Java dependency on JDK NumberFormat.
 Risk โ€“ NumberFormat may require coordinated modifications.
 Mitigation โ€“ Coordinate with JDK release;
 Supply NumberFormats and similar classes that augment JDK content.
 Plan โ€“ There is also a Java dependency on JDK NumberFormat.
 Risk โ€“ NumberFormat may require coordinated modifications.
 Mitigation โ€“ Coordinate with JDK release;
 Supply NumberFormats and similar classes that augment JDK content.

                                                                      18
The JSR
Expert Group Members
 โ€ข   Credit Suisse
 โ€ข   Goldman Sachs
 โ€ข   Stephen Colebourne
 โ€ข   Ben Evans
 โ€ข   Werner Keil
 โ€ข   Bob Lee




                          20
Supporting the JSR
 โ€ข   Credit Suisse
 โ€ข   Caxton Associates
 โ€ข   Goldman Sachs
 โ€ข   JP Morgan/Chase
 โ€ข   London Java Community
 โ€ข   Stephen Colebourne
 โ€ข   Werner Keil


                             21
Schedule
 โ€ข       Targeted to Java 9
 โ€ข       Aiming at Java ME/Embedded 8 or 9
     โ€ข    Following the EC Merge and Standard/Embedded harmonization, no JSR should be SE/EE or
          ME only, with very few, specialized exceptions. Money is so important, and has almost no
          legacy in the JDK except java.util.Currency, that it should be supported by ALL POSSIBLE
          platforms, except maybe JavaCard for now.

 โ€ข       With back-port to previous versions still supported and in relevant use




                                                                                                     22
Virtual Currencies




                     23
Facebook Credits
 What are Facebook Credits?
 โ€ข Facebook Credits are a virtual currency you can use to buy virtual goods
 in any games or apps of the Facebook platform that accept payments. You
 can purchase Facebook Credits directly from within an app using your
 credit card, PayPal, mobile phone and many other local payment methods.

 โ–บ Hence any such purchase is practically a conversion,
       similar to if you buy a foreign currency when
       travelling abroadโ˜บ

                                                                              24
Top 10 Video Game Currencies
 1. Gold
 2. Gil
 3. Rupees (not Indian;-)
 4. Credits
 5. Gold Rings
 6. Hearts
 7. Zenny
 8. Potch
 9. Munny
 10.Nuyen                      25
World Currencies




                   26
Currency Exchange
Currency Conversion (JScience)




                                 28
Online Currency Conversion Example




                                     29
Trading Application Example
    What happens, if we use built in java.util.Currency and Standard
                             JSP formats




                                                                       30
Demos
Q&A
Links

   โ€ข The JSR: http://jcp.org/en/jsr/summary?
     id=354

   โ€ข java.net Project:
     http://java.net/projects/javamoney/

   โ€ข GitHub Project:
     http://github.com/JavaMoney/
Links (2)

   โ€ข Eclipse UOMo:
     http://www.eclipse.org/uomo/

   โ€ข JScience:
     http://www.jscience.org

   โ€ข JodaMoney:
     http://joda-money.sourceforge.net/

More Related Content

Similar to JSR 354 - Money and Currency API for Java

Groovy On The Trading Desk
Groovy On The Trading DeskGroovy On The Trading Desk
Groovy On The Trading Desk
Jonathan Felch
ย 
2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx
2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx
2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx
GauravGamer2
ย 

Similar to JSR 354 - Money and Currency API for Java (20)

Java in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MJava in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/M
ย 
Polyglot and functional (Devoxx Nov/2011)
Polyglot and functional (Devoxx Nov/2011)Polyglot and functional (Devoxx Nov/2011)
Polyglot and functional (Devoxx Nov/2011)
ย 
How do we drive tech changes
How do we drive tech changesHow do we drive tech changes
How do we drive tech changes
ย 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)
ย 
Behavior-Driven Development (BDD) Testing with Apache Spark with Aaron Colcor...
Behavior-Driven Development (BDD) Testing with Apache Spark with Aaron Colcor...Behavior-Driven Development (BDD) Testing with Apache Spark with Aaron Colcor...
Behavior-Driven Development (BDD) Testing with Apache Spark with Aaron Colcor...
ย 
JavaOne Latin America Participate in Shaping Java's Future
JavaOne Latin America Participate in Shaping Java's Future JavaOne Latin America Participate in Shaping Java's Future
JavaOne Latin America Participate in Shaping Java's Future
ย 
Case Study of Financial Web System Development and Operations with Oracle Web...
Case Study of Financial Web System Development and Operations with Oracle Web...Case Study of Financial Web System Development and Operations with Oracle Web...
Case Study of Financial Web System Development and Operations with Oracle Web...
ย 
MyAppConverter DroidconUK 2014
MyAppConverter DroidconUK 2014MyAppConverter DroidconUK 2014
MyAppConverter DroidconUK 2014
ย 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
ย 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developed
ย 
Go for the Money - JSR 354
Go for the Money - JSR 354Go for the Money - JSR 354
Go for the Money - JSR 354
ย 
Groovy On The Trading Desk
Groovy On The Trading DeskGroovy On The Trading Desk
Groovy On The Trading Desk
ย 
Moneyandcurrency2
Moneyandcurrency2Moneyandcurrency2
Moneyandcurrency2
ย 
Creating a Comprehensive Social Media App Using Ionic and Phone Gap
Creating a Comprehensive Social Media App Using Ionic and Phone GapCreating a Comprehensive Social Media App Using Ionic and Phone Gap
Creating a Comprehensive Social Media App Using Ionic and Phone Gap
ย 
Java, now and forever
Java, now and foreverJava, now and forever
Java, now and forever
ย 
slides-students-C03.pdf
slides-students-C03.pdfslides-students-C03.pdf
slides-students-C03.pdf
ย 
2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx
2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx
2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx
ย 
Java EE - Finest basics
Java EE - Finest basicsJava EE - Finest basics
Java EE - Finest basics
ย 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)
ย 
Join the Java Evolution NYC
Join the Java Evolution NYCJoin the Java Evolution NYC
Join the Java Evolution NYC
ย 

More from Werner Keil

Securing eHealth, eGovernment and eBanking with Java - DWX '21
Securing eHealth, eGovernment and eBanking with Java - DWX '21Securing eHealth, eGovernment and eBanking with Java - DWX '21
Securing eHealth, eGovernment and eBanking with Java - DWX '21
Werner Keil
ย 

More from Werner Keil (20)

Securing eHealth, eGovernment and eBanking with Java - DWX '21
Securing eHealth, eGovernment and eBanking with Java - DWX '21Securing eHealth, eGovernment and eBanking with Java - DWX '21
Securing eHealth, eGovernment and eBanking with Java - DWX '21
ย 
OpenDDR and Jakarta MVC - JavaLand 2021
OpenDDR and Jakarta MVC - JavaLand 2021OpenDDR and Jakarta MVC - JavaLand 2021
OpenDDR and Jakarta MVC - JavaLand 2021
ย 
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
ย 
OpenDDR and Jakarta MVC - Java2Days 2020 Virtual
OpenDDR and Jakarta MVC - Java2Days 2020 VirtualOpenDDR and Jakarta MVC - Java2Days 2020 Virtual
OpenDDR and Jakarta MVC - Java2Days 2020 Virtual
ย 
NoSQL Endgame - Java2Days 2020 Virtual
NoSQL Endgame - Java2Days 2020 VirtualNoSQL Endgame - Java2Days 2020 Virtual
NoSQL Endgame - Java2Days 2020 Virtual
ย 
JCON 2020: Mobile Java Web Applications with MVC and OpenDDR
JCON 2020: Mobile Java Web Applications with MVC and OpenDDRJCON 2020: Mobile Java Web Applications with MVC and OpenDDR
JCON 2020: Mobile Java Web Applications with MVC and OpenDDR
ย 
How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020
How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020
How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020
ย 
Money, Money, Money, can be funny with JSR 354 (Devoxx BE)
Money, Money, Money, can be funny with JSR 354 (Devoxx BE)Money, Money, Money, can be funny with JSR 354 (Devoxx BE)
Money, Money, Money, can be funny with JSR 354 (Devoxx BE)
ย 
NoSQL: The first New Jakarta EE Specification (DWX 2019)
NoSQL: The first New Jakarta EE Specification (DWX 2019)NoSQL: The first New Jakarta EE Specification (DWX 2019)
NoSQL: The first New Jakarta EE Specification (DWX 2019)
ย 
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR DayHow JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
ย 
JNoSQL: The Definitive Solution for Java and NoSQL Databases
JNoSQL: The Definitive Solution for Java and NoSQL DatabasesJNoSQL: The Definitive Solution for Java and NoSQL Databases
JNoSQL: The Definitive Solution for Java and NoSQL Databases
ย 
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL DatabasesEclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
ย 
Physikal - Using Kotlin for Clean Energy - KUG Munich
Physikal - Using Kotlin for Clean Energy - KUG MunichPhysikal - Using Kotlin for Clean Energy - KUG Munich
Physikal - Using Kotlin for Clean Energy - KUG Munich
ย 
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
ย 
Performance Monitoring for the Cloud - Java2Days 2017
Performance Monitoring for the Cloud - Java2Days 2017Performance Monitoring for the Cloud - Java2Days 2017
Performance Monitoring for the Cloud - Java2Days 2017
ย 
Eclipse Science F2F 2016 - JSR 363
Eclipse Science F2F 2016 - JSR 363Eclipse Science F2F 2016 - JSR 363
Eclipse Science F2F 2016 - JSR 363
ย 
Java2Days - Security for JavaEE and the Cloud
Java2Days - Security for JavaEE and the CloudJava2Days - Security for JavaEE and the Cloud
Java2Days - Security for JavaEE and the Cloud
ย 
Apache DeviceMap - Web-Dev-BBQ Stuttgart
Apache DeviceMap - Web-Dev-BBQ StuttgartApache DeviceMap - Web-Dev-BBQ Stuttgart
Apache DeviceMap - Web-Dev-BBQ Stuttgart
ย 
The First IoT JSR: Units of Measurement - JUG Berlin-Brandenburg
The First IoT JSR: Units of Measurement - JUG Berlin-BrandenburgThe First IoT JSR: Units of Measurement - JUG Berlin-Brandenburg
The First IoT JSR: Units of Measurement - JUG Berlin-Brandenburg
ย 
JSR 354: Money and Currency API - Short Overview
JSR 354: Money and Currency API - Short OverviewJSR 354: Money and Currency API - Short Overview
JSR 354: Money and Currency API - Short Overview
ย 

Recently uploaded

Call Girls Banaswadi Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service Ban...
Call Girls Banaswadi Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service Ban...Call Girls Banaswadi Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service Ban...
Call Girls Banaswadi Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service Ban...
amitlee9823
ย 
Call Girls in New Ashok Nagar, (delhi) call me [9953056974] escort service 24X7
Call Girls in New Ashok Nagar, (delhi) call me [9953056974] escort service 24X7Call Girls in New Ashok Nagar, (delhi) call me [9953056974] escort service 24X7
Call Girls in New Ashok Nagar, (delhi) call me [9953056974] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
VIP Call Girl in Mumbai Central ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Ever...
VIP Call Girl in Mumbai Central ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Ever...VIP Call Girl in Mumbai Central ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Ever...
VIP Call Girl in Mumbai Central ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Ever...
dipikadinghjn ( Why You Choose Us? ) Escorts
ย 
CBD Belapur Expensive Housewife Call Girls Number-๐Ÿ“ž๐Ÿ“ž9833754194 No 1 Vipp HIgh...
CBD Belapur Expensive Housewife Call Girls Number-๐Ÿ“ž๐Ÿ“ž9833754194 No 1 Vipp HIgh...CBD Belapur Expensive Housewife Call Girls Number-๐Ÿ“ž๐Ÿ“ž9833754194 No 1 Vipp HIgh...
CBD Belapur Expensive Housewife Call Girls Number-๐Ÿ“ž๐Ÿ“ž9833754194 No 1 Vipp HIgh...
priyasharma62062
ย 
VIP Call Girl Service Andheri West โšก 9920725232 What It Takes To Be The Best ...
VIP Call Girl Service Andheri West โšก 9920725232 What It Takes To Be The Best ...VIP Call Girl Service Andheri West โšก 9920725232 What It Takes To Be The Best ...
VIP Call Girl Service Andheri West โšก 9920725232 What It Takes To Be The Best ...
dipikadinghjn ( Why You Choose Us? ) Escorts
ย 
VIP Independent Call Girls in Mira Bhayandar ๐ŸŒน 9920725232 ( Call Me ) Mumbai ...
VIP Independent Call Girls in Mira Bhayandar ๐ŸŒน 9920725232 ( Call Me ) Mumbai ...VIP Independent Call Girls in Mira Bhayandar ๐ŸŒน 9920725232 ( Call Me ) Mumbai ...
VIP Independent Call Girls in Mira Bhayandar ๐ŸŒน 9920725232 ( Call Me ) Mumbai ...
dipikadinghjn ( Why You Choose Us? ) Escorts
ย 
VIP Call Girl in Mira Road ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Everyday ...
VIP Call Girl in Mira Road ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Everyday ...VIP Call Girl in Mira Road ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Everyday ...
VIP Call Girl in Mira Road ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Everyday ...
dipikadinghjn ( Why You Choose Us? ) Escorts
ย 
Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 9352852248 Cal...
Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 9352852248 Cal...Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 9352852248 Cal...
Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 9352852248 Cal...
roshnidevijkn ( Why You Choose Us? ) Escorts
ย 

Recently uploaded (20)

Call Girls Banaswadi Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service Ban...
Call Girls Banaswadi Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service Ban...Call Girls Banaswadi Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service Ban...
Call Girls Banaswadi Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service Ban...
ย 
(INDIRA) Call Girl Mumbai Call Now 8250077686 Mumbai Escorts 24x7
(INDIRA) Call Girl Mumbai Call Now 8250077686 Mumbai Escorts 24x7(INDIRA) Call Girl Mumbai Call Now 8250077686 Mumbai Escorts 24x7
(INDIRA) Call Girl Mumbai Call Now 8250077686 Mumbai Escorts 24x7
ย 
Top Rated Pune Call Girls Dighi โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Dighi โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Dighi โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Dighi โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex Servi...
ย 
7 tips trading Deriv Accumulator Options
7 tips trading Deriv Accumulator Options7 tips trading Deriv Accumulator Options
7 tips trading Deriv Accumulator Options
ย 
Call Girls in New Ashok Nagar, (delhi) call me [9953056974] escort service 24X7
Call Girls in New Ashok Nagar, (delhi) call me [9953056974] escort service 24X7Call Girls in New Ashok Nagar, (delhi) call me [9953056974] escort service 24X7
Call Girls in New Ashok Nagar, (delhi) call me [9953056974] escort service 24X7
ย 
W.D. Gann Theory Complete Information.pdf
W.D. Gann Theory Complete Information.pdfW.D. Gann Theory Complete Information.pdf
W.D. Gann Theory Complete Information.pdf
ย 
VIP Call Girl in Mumbai Central ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Ever...
VIP Call Girl in Mumbai Central ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Ever...VIP Call Girl in Mumbai Central ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Ever...
VIP Call Girl in Mumbai Central ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Ever...
ย 
Vasai-Virar Fantastic Call Girls-9833754194-Call Girls MUmbai
Vasai-Virar Fantastic Call Girls-9833754194-Call Girls MUmbaiVasai-Virar Fantastic Call Girls-9833754194-Call Girls MUmbai
Vasai-Virar Fantastic Call Girls-9833754194-Call Girls MUmbai
ย 
Call Girls in New Friends Colony Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9205541914 ๐Ÿ”( Delhi) Escort...
Call Girls in New Friends Colony Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9205541914 ๐Ÿ”( Delhi) Escort...Call Girls in New Friends Colony Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9205541914 ๐Ÿ”( Delhi) Escort...
Call Girls in New Friends Colony Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9205541914 ๐Ÿ”( Delhi) Escort...
ย 
CBD Belapur Expensive Housewife Call Girls Number-๐Ÿ“ž๐Ÿ“ž9833754194 No 1 Vipp HIgh...
CBD Belapur Expensive Housewife Call Girls Number-๐Ÿ“ž๐Ÿ“ž9833754194 No 1 Vipp HIgh...CBD Belapur Expensive Housewife Call Girls Number-๐Ÿ“ž๐Ÿ“ž9833754194 No 1 Vipp HIgh...
CBD Belapur Expensive Housewife Call Girls Number-๐Ÿ“ž๐Ÿ“ž9833754194 No 1 Vipp HIgh...
ย 
VIP Call Girl Service Andheri West โšก 9920725232 What It Takes To Be The Best ...
VIP Call Girl Service Andheri West โšก 9920725232 What It Takes To Be The Best ...VIP Call Girl Service Andheri West โšก 9920725232 What It Takes To Be The Best ...
VIP Call Girl Service Andheri West โšก 9920725232 What It Takes To Be The Best ...
ย 
VIP Independent Call Girls in Mira Bhayandar ๐ŸŒน 9920725232 ( Call Me ) Mumbai ...
VIP Independent Call Girls in Mira Bhayandar ๐ŸŒน 9920725232 ( Call Me ) Mumbai ...VIP Independent Call Girls in Mira Bhayandar ๐ŸŒน 9920725232 ( Call Me ) Mumbai ...
VIP Independent Call Girls in Mira Bhayandar ๐ŸŒน 9920725232 ( Call Me ) Mumbai ...
ย 
Stock Market Brief Deck (Under Pressure).pdf
Stock Market Brief Deck (Under Pressure).pdfStock Market Brief Deck (Under Pressure).pdf
Stock Market Brief Deck (Under Pressure).pdf
ย 
Top Rated Pune Call Girls Viman Nagar โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex...
Top Rated  Pune Call Girls Viman Nagar โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex...Top Rated  Pune Call Girls Viman Nagar โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex...
Top Rated Pune Call Girls Viman Nagar โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex...
ย 
Diva-Thane European Call Girls Number-9833754194-Diva Busty Professional Call...
Diva-Thane European Call Girls Number-9833754194-Diva Busty Professional Call...Diva-Thane European Call Girls Number-9833754194-Diva Busty Professional Call...
Diva-Thane European Call Girls Number-9833754194-Diva Busty Professional Call...
ย 
Mira Road Memorable Call Grls Number-9833754194-Bhayandar Speciallty Call Gir...
Mira Road Memorable Call Grls Number-9833754194-Bhayandar Speciallty Call Gir...Mira Road Memorable Call Grls Number-9833754194-Bhayandar Speciallty Call Gir...
Mira Road Memorable Call Grls Number-9833754194-Bhayandar Speciallty Call Gir...
ย 
VIP Call Girl in Mira Road ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Everyday ...
VIP Call Girl in Mira Road ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Everyday ...VIP Call Girl in Mira Road ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Everyday ...
VIP Call Girl in Mira Road ๐Ÿ’ง 9920725232 ( Call Me ) Get A New Crush Everyday ...
ย 
Kopar Khairane Russian Call Girls Number-9833754194-Navi Mumbai Fantastic Unl...
Kopar Khairane Russian Call Girls Number-9833754194-Navi Mumbai Fantastic Unl...Kopar Khairane Russian Call Girls Number-9833754194-Navi Mumbai Fantastic Unl...
Kopar Khairane Russian Call Girls Number-9833754194-Navi Mumbai Fantastic Unl...
ย 
Navi Mumbai Cooperetive Housewife Call Girls-9833754194-Natural Panvel Enjoye...
Navi Mumbai Cooperetive Housewife Call Girls-9833754194-Natural Panvel Enjoye...Navi Mumbai Cooperetive Housewife Call Girls-9833754194-Natural Panvel Enjoye...
Navi Mumbai Cooperetive Housewife Call Girls-9833754194-Natural Panvel Enjoye...
ย 
Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 9352852248 Cal...
Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 9352852248 Cal...Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 9352852248 Cal...
Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 9352852248 Cal...
ย 

JSR 354 - Money and Currency API for Java

  • 1. JSR 354 Java Money and Currency API Werner Keil Build Manager, DevOps Expert, Agile Coach Maersk Line EG Member, JSR 354 @wernerkeil
  • 2. Werner Keil - Bio โ€ข Consultant โ€“ Coach โ€ข Creative Cosmopolitan โ€ข Open Source Evangelist โ€ข Software Architect โ€ข Java Godfather โ€ข JCP Executive Committee Member โ€ข Eclipse UOMo Project Lead โ€ข DevOps Guy 2
  • 3. Show me the Money!
  • 4. Agenda โ€ข History โ€ข Motivation โ€ข The JSR โ€ข Virtual Currencies โ€ข Currency Exchange โ€ข Demos โ€ข Q&A 4
  • 6. Earlier Approaches Martin Fowler: A large proportion of the computers in this world manipulate money, so it's always puzzled me that money isn't actually a first class data type in any mainstream programming language.The lack of a type causes problems, the most obvious surrounding currenciesโ€ฆ see http://martinfowler.com/eaaCatalog/money.html 6
  • 7. Earlier Approaches (2) Eric Evans โ€“ Time and Money: On project after project, software developers have to reinvent the wheel, creating objects for simple recurring concepts such as "money" and "currency". Although most languages have a "date" or "time" object, these are rudimentary, and do not cover many needs, such as recurring sequences of time, durations of time, or intervals of time. โ€ฆ see http://timeandmoney.sourceforge.net/ To be quite frank, their code isnโ€˜t more than an academic POC, factories called dollars() or euros() are useless in real globally deployed frameworks, but he made a good point. 7
  • 10. Summary โ€ข This JSR will provide a money and currency API for Java, targeted at all users of currencies and monetary amounts in Java. โ€ข The API will provide support for standard ISO-4217 and Custom (e.g. Virtual) currencies, as well as representation of a monetary amount. โ€ข It willsupport currency arithmetic, even across di๏ฌ€erent currencies, and foreign currency exchange. โ€ข Additionally, implementation details surrounding serialization and thread safety are to be considered 10
  • 11. Why is it needed? โ€ข Monetary values are a key feature to many applications. โ€ข The existing java.util.Currency class is strictly a structure usedfor representing ISO-4217 standard currencies. โ€ข No standard value type to represent a monetary amount. โ€ข No support for currency arithmetic or conversion 11
  • 12. Challenges โ€ข Keep it simple โ€“ Remember the most common use case โ€ขAdding currency values e.g. in an e-commerce app. โ€ข Performance โ€ขHow to support low latency applications, such as High Frequency Trading apps. โ€ข Precision โ€ขThere can potentially be differing precisions specified for arithmetic, currency exchange and formatting 12
  • 13. Challenges (2) โ€ข Formatting โ€ขRequirement should be to use existing Number Formats. โ€ขHowever there is no existing format representing for example Indian Rupees: which might look something like this: 12,34,00,000 โ€ขNatural language support for non-decimal valuations for example โ€ข Lakhs โ€ข Crores โ€ข 1 Lakh = 100,000 โ€ข 1 Crore = 100 Lakh 13
  • 14. Challenges (3) โ€ข Formatting โ€ข12,34,56,000.21 is written 12 Crore, 34 Lakh, 56 Thousand Rupees and 21 Paise โ€ข Support for non-standard rounding modes 14
  • 15. Non-standard Rounding Modes โ€ข It is a big world, and each country has its regulations and cultural nuances for expressing currencies in natural language, rounding policies, groupings, etc. โ€ข For example, in Argentina rounding is prescribed for the third digit after the decimal point: If the third digit is 2 or less, change it to 0 or drop it. If the third digit is between 3 and 7, change it to 5. If the third digit is 8 or more, add one to the second digit and drop the third digit or change it to 0. 15
  • 16. Non-standard Rounding โ€“ Argentina Argentina Rounding Examples Original Number Rounded Notes 123.452 123.45 Third digit<3 round down 123.456 123.455 3<=third digit<=7 change to 5 123.459 123.46 Third digit>=8 round up Switzerland uses a similar rounding strategy. 16
  • 17. Risks Plan โ€“ โ€œMoney and Currencyโ€ is a formidable and dynamic category with regional dependencies, requiring programmers, business users, international accountants, and attorneys. Risk โ€“ Incomplete or outdated spec Mitigation โ€“ Resulting API should be flexible, let application developer change implementation as needed. 17
  • 18. Risks (2) Plan โ€“ There is also a Java dependency on JDK NumberFormat. Risk โ€“ NumberFormat may require coordinated modifications. Mitigation โ€“ Coordinate with JDK release; Supply NumberFormats and similar classes that augment JDK content. Plan โ€“ There is also a Java dependency on JDK NumberFormat. Risk โ€“ NumberFormat may require coordinated modifications. Mitigation โ€“ Coordinate with JDK release; Supply NumberFormats and similar classes that augment JDK content. 18
  • 20. Expert Group Members โ€ข Credit Suisse โ€ข Goldman Sachs โ€ข Stephen Colebourne โ€ข Ben Evans โ€ข Werner Keil โ€ข Bob Lee 20
  • 21. Supporting the JSR โ€ข Credit Suisse โ€ข Caxton Associates โ€ข Goldman Sachs โ€ข JP Morgan/Chase โ€ข London Java Community โ€ข Stephen Colebourne โ€ข Werner Keil 21
  • 22. Schedule โ€ข Targeted to Java 9 โ€ข Aiming at Java ME/Embedded 8 or 9 โ€ข Following the EC Merge and Standard/Embedded harmonization, no JSR should be SE/EE or ME only, with very few, specialized exceptions. Money is so important, and has almost no legacy in the JDK except java.util.Currency, that it should be supported by ALL POSSIBLE platforms, except maybe JavaCard for now. โ€ข With back-port to previous versions still supported and in relevant use 22
  • 24. Facebook Credits What are Facebook Credits? โ€ข Facebook Credits are a virtual currency you can use to buy virtual goods in any games or apps of the Facebook platform that accept payments. You can purchase Facebook Credits directly from within an app using your credit card, PayPal, mobile phone and many other local payment methods. โ–บ Hence any such purchase is practically a conversion, similar to if you buy a foreign currency when travelling abroadโ˜บ 24
  • 25. Top 10 Video Game Currencies 1. Gold 2. Gil 3. Rupees (not Indian;-) 4. Credits 5. Gold Rings 6. Hearts 7. Zenny 8. Potch 9. Munny 10.Nuyen 25
  • 30. Trading Application Example What happens, if we use built in java.util.Currency and Standard JSP formats 30
  • 31. Demos
  • 32. Q&A
  • 33. Links โ€ข The JSR: http://jcp.org/en/jsr/summary? id=354 โ€ข java.net Project: http://java.net/projects/javamoney/ โ€ข GitHub Project: http://github.com/JavaMoney/
  • 34. Links (2) โ€ข Eclipse UOMo: http://www.eclipse.org/uomo/ โ€ข JScience: http://www.jscience.org โ€ข JodaMoney: http://joda-money.sourceforge.net/