SlideShare a Scribd company logo
1 of 44
Download to read offline
Go for the Money
JSR 354 Hackday
London Java Community 2014
June 2014
Go for the money –JSR 354 Hackday
http://java.net/projects/javamoney
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Bio
Anatole Tresch
Consultant, Coach
Credit Suisse
Technical Coordinator &
Architect
Specification Lead JSR 354
Regular Conference Speaker
Driving Java EE Config
Twitter/Google+: @atsticks
atsticks@java.net
anatole.tresch@credit-suisse.com
Java Config Discussion https://groups.google.com/forum/#!forum/java-config
Java Config Blog: http://javaeeconfig.blogspot.ch
Zurich Java Community (Google Community)
Zurich Hackergarten
2
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Agenda
3
Introduction
Possible Topics
Easy:
API Challenge: Moneymachine
Medium:
Adding functonalities to the RI,
e.g. Special Roundings
BitCoin and other currencies
Test Financial Formulas in JavaMoney
Hard
Improve FastMoney
Measure CPU and Memory Consumption
Write a Complex Integration Sample
Setup
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Introduction
javax.money
4
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Currencies
API
5
Allow currencies with arbitrary other currency codes
Register additional Currency Units using an flexible SPI
Fluent API using a Builder (RI only)
(Historic Validity of currencies related to regions/countries and
vice versa (not part of JSR, but javamoney OSS project))
public interface CurrencyUnit{
public String getCurrencyCode();
public int getNumericCode();
public int getDefaultFractionDigits();
}
public final class MonetaryCurrencies{
public CurrencyUnit getCurrency(String currencyCode);
public CurrencyUnit getCurrency(Locale locale);
public boolean isCurrencyAvailable(String currencyCode);
public boolean isCurrencyAvailable(String locale);
}
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Currencies (continued)
API Samples
CurrencyUnit currency1 = MonetaryCurrencies.getCurrency("USD");
CurrencyUnit currency2 = MonetaryCurrencies.getCurrency(
Locale.GERMANY);
CurrencyUnit bitcoin = new BuildableCurrencyUnit.Builder("BTC")
.setNumericCode(123456)
.setDefaultFractionDigits(8)
.create();
6
Access a CurrencyUnit
Build a CurrencyUnit (RI only)
Register a CurrencyUnit
CurrencyUnit bitcoin = ….create(true);
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Monetary Amounts
General Aspects
7
Amount = Currency + Numeric Value
+ Capabilities
Arithmetic Functions, Comparison
Fluent API
Functional design for extendible functionality
(MonetaryOperator, MonetaryQuery)
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Monetary Amounts (continued)
Key Decisions
8
Support Several Numeric Representations (instead of one
single fixed value type)
Define Implementation Recommendations
• Rounding should to be modelled as separate concern
(a MonetaryOperator)
• Ensure Interoperability by the MonetaryAmount
interface
• Precision/scale capabilities should be inherited to its
operational results.
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Monetary Amounts (continued)
The API
public interface MonetaryAmount{
public CurrencyUnit getCurrency();
public NumberValue getNumber();
public MonetaryContext getMonetaryContext();
public MonetaryAmount with(MonetaryOperator operator);
public <R> R query(MonetaryQuery<R> query);
public MonetaryAmountFactory<? extends MonetaryAmount> getFactory();
…
public boolean isLessThanOrEqualTo(MonetaryAmount amt);
public boolean isLessThan(MonetaryAmount amt);
public boolean isEqualTo(MonetaryAmount amt);
public int signum();
…
public MonetaryAmount add(MonetaryAmount amount);
public MonetaryAmount subtract(MonetaryAmount amount);
public MonetaryAmount divide(long number);
public MonetaryAmount multiply(Number number);
public MonetaryAmount remainder(double number);
…
public MonetaryAmount stripTrailingZeros();
}
9
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Monetary Context
Modeling Amount Capabilities
10
Describes the capabilities of a MonetaryAmount.
Accessible from each MonetaryAmount instance.
Allows querying a feasible implementation type from
MonetaryAmounts.
Contains
common aspects
Max precision, max scale, implementation type
Arbitrary attributes
E.g. RoundingMode, MathContext, …
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Monetary Context (continued)
The API
public final class MonetaryContext extends AbstractContext
implements Serializable {
public int getPrecision();
public int getMaxScale();
public Class<? extends MonetaryAmount> getAmountType();
public static final class Builder{…}
}
public abstract class AbstractContext implements Serializable{
…
public <T> T getNamedAttribute(Class<T> type, Object key,
T defaultValue);
public <T> T getNamedAttribute(Class<T> type, Object key);
public <T> T getAttribute(Class<T> type, T defaultValue);
public <T> T getAttribute(Class<T> type);
public Set<Class<?>> getAttributeTypes();
}
11
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Creating Monetary Amounts
Monetary Amount Factory
12
Creates new instances of MonetaryAmount.
Declares
The concrete MonetaryAmount implementation type
returned.
The min/max MonetaryContext supported.
Can be configured with a target
CurrencyUnit
A numeric value
MonetaryContext.
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Creating Monetary Amounts (continued)
Monetary Amount Factory
public interface MonetaryAmountFactory<T extends MonetaryAmount> {
Class<? extends MonetaryAmount> getAmountType();
MonetaryAmountFactory<T> setCurrency(String currencyCode);
MonetaryAmountFactory<T> setCurrency(CurrencyUnit currency);
MonetaryAmountFactory<T> setNumber(double number);
MonetaryAmountFactory<T> setNumber(long number);
MonetaryAmountFactory<T> setNumber(Number number);
MonetaryAmountFactory<T> setContext(MonetaryContext monetaryContext);
MonetaryAmountFactory<T> setAmount(MonetaryAmount amount);
MonetaryContext getDefaultMonetaryContext();
MonetaryContext getMaximalMonetaryContext();
T create();
}
13
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Creating Monetary Amounts
Usage Samples
// Using the default type
MonetaryAmount amount1 = MonetaryAmounts.getAmountFactory()
.setCurrency("USD“)
.setNumber(1234566.15)
.create();
// Using an explicit type
Money amount2 = MonetaryAmounts.getAmountFactory(Money.class)
.setCurrency("USD“)
.setNumber(1234566.15)
.create();
// Query a matching implementation type
MonetaryContext monCtx = new MonetaryContext.Builder()
.setAmountFlavor(
AmountFlavor.PERFORMANT)
.create();
Class<? extends MonetaryAmount> type = MonetaryAmounts.queryAmontType(
monCtx);
MonetaryAmountFactory<?> fact = MonetaryAmounts.queryAmountFactory(
monCtx);
14
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Extension Points
MonetaryOperator
 Takes an amount and procudes some other amount.
• With different value
• With different currency
• Or both
// @FunctionalInterface
public interface MonetaryOperator {
public MonetaryAmount apply(MonetaryAmount amount);
}
• Operators then can be applied on every MonetaryAmount:
public interface MonetaryAmount{
…
public MonetaryAmount with (MonetaryOperator operator);
…
}
15
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Extension Points (continued)
MonetaryOperator: Use Cases
Extend the algorithmic capabilities
• Percentages
• Permil
• Different Minor Units
• Different Major Units
• Rounding
• Currency Conversion
• Financial Calculations
• …
16
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Extension Points (continued)
MonetaryOperator Example: Rounding and Percentage
17
// round an amount
MonetaryOperator rounding =
MoneyRoundings.getRounding(
MonetaryCurrencies.getCurrency(“USD”));
Money amount = Money.of(“USD”, 12.345567);
Money rounded = amount.with(rounding); // USD 12.35
// MonetaryFunctions, e.g. calculate 3% of it
Money threePercent = rounded.with(
MonetaryFunctions.getPercent(3));
// USD 0.3705
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Extension Points (continued)
MonetaryQuery
 A MonetaryQuery takes an amount and procuces an arbitrary
result:
// @FunctionalInterface
public interface MonetaryQuery<T> {
public T queryFrom(MonetaryAmount amount);
}
 Queries then can be applied on every MonetaryAmount:
public interface MonetaryAmount {
…
public <T> T query (MonetaryQuary<T> query);
…
}
18
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Currency Conversion
javax.money.convert.*
19
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Currency Conversion
ExchangeRate
 A ExchangeRate models a conversion between two currencies:
• Base CurrencyUnit
• Terminating/target CurrencyUnit
• Provider
• Conversion Factor, where M(term) = M(base) * f
• Additional attributes (ConversionContext)
• Rate chain (composite rates)
 Rates may be direct or derived (composite rates)
20
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Currency Conversion
ExchangeRateProvider
// access default provider (chain)
ExchangeRateProvider prov =
MonetaryConversions.getExchangeRateProvider();
// access a provider explicitly
prov = MonetaryConversions.getExchangeRateProvider("IMF");
// access explicit provider chain
prov = MonetaryConversions.getExchangeRateProvider("ECB", "IMF");
// access Exchange rates
ExchangeRate rate = provider.getExchangeRate("EUR", "CHF");
// Passing additional parameters
ExchangeRate rate = provider.getExchangeRate("EUR", "CHF",
ConversionContext.of(
System.currentTimeMillis() + 2000L) );
21Go for the money - JSR 354 - http://java.net/projects/javamoney
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Currency Conversion (continued)
Performing Conversion
Accessing a CurrencyConversion (always targeted to a terminating
CurrencyUnit):
// access from a ExchangeRateProvider
ExchangeRateProvider prov = …;
CurrencyConversion conv = prov.getCurrencyConversion("INR");
// access it directly (using default rate chain)
conv = MonetaryConversions.getConversion("INR");
// access it, using explicit provider chain
conv = MonetaryConversions.getConversion("INR", "ECB", "IMF");
Performing conversion:
MonetaryAmount chfAmount = MonetaryAmounts.of("CHF",10.50);
MonetaryAmount inrAmount = chfAmount.with(conv); // around EUR 8.75
22
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Formatting and Parsing
javax.money.format.*
23
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Formatting and Parsing
MonetaryAmountFormat
Similar to java.text.DecimalFormat accessible by Locale
Configured by AmountFormatContext
Supports also custom formats (configured an accessed using
AmountFormatContext)
Building AmountFormatContext using a fluent API
Thread safe!
24Go for the money - JSR 354 - http://java.net/projects/javamoney
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Formatting and Parsing (continued)
MonetaryAmountFormat: Usage Example
// Access a provided format
MonetaryAmountFormat format = MonetaryFormats.getAmountFormat(
new Locale(“”, “in”));
System.out.println(format.format(
Money.of("INR", 39101112.123456))));
-> INR 3,91,01,112.10
// Access a custom format
MonetaryAmountFormat format = MonetaryFormats.getAmountFormat(
AmountFormatContext.of(“myCustomFormat”));
25Go for the money - JSR 354 - http://java.net/projects/javamoney
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
JavaMoney OSS Project
org.javamoney.*
26
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
JavaMoney OSS Project
Extended Currency Services
 Currency namespaces (e.g. ISO, VIRTUAL, …)
 Currency namespace mapping
Validity Services (Historization API)
• access of historic currency data related to regions
Region Services
 Region Forest
• Unicode CLDR region tree
• ISO 2-, 3-letter countries
• Custom Trees
Extendible token-based Formatting API
Financial Calculations & Formulas
27
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Links
Current Spec (work in progress, comments allowed):
https://docs.google.com/document/d/1FfihURoCYrbkDcSf1W
XM6fHoU3d3tKooMnZLCpmpyV8/edit
GitHub Project (JSR and JavaMoney):
https://github.com/JavaMoney/javamoney
Umbrella Page: http://javamoney.org
JSR 354: http://jcp.org
Java.net Project: http://java.net/projects/javamoney
JUG Chennai Adoption (TrakStok):
https://github.com/jugchennaiadoptjava/TrakStok
Twitter: @jsr354
Cash Rounding: http://en.wikipedia.org/wiki/Swedish_rounding
28
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
HackDay - Possible Topics
29
Easy
- Money Machine
Medium
- Extending RI
- RI User Guide
- JavaMoney Lib
- TCK
Hard
- L & P
- Create Sample App
- Implement a RI
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Adoption Areas JSR 354 – The Easy Way
API Challenge: MoneyMachine
30
Objective: Test the API for usability, make proposals to
improve
How:
Checkout/update the MoneyMachine project from
https://github.com/atsticks/moneymachine.git
Implement the classes in the src/main/java to
make the tests green (skeletons are already there)
The challenge will guide you throughout the whole JSR
Overall 40+ test cases of different complexity (easy to
medium), you may also select only a subset ;-)
Add improvement proposals to the JSRs JIRA on
java.net
Blog your (hopefully positive) experience, twitter, …
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Adoption Areas JSR 354 – The Easy Way
API Challenge: MoneyMachine Example
31
/**
* This class has to be implemented and helps us giving feedback on the JSR's API. This
* part of the
* project deals with basic aspects such as getting currencies and amounts.
* Created by Anatole on 07.03.14.
*/
public class Basics{
/**
* Get a CurrencyUnit using a currency code.
*
* @param currencyCode the currency code
* @return the corresponding CurrencyUnit instance.
*/
public CurrencyUnit getProvidedCurrency(String currencyCode){
throw new UnsupportedOperationException();
}
/**
* Get a CurrencyUnit using a Locale, modeling a country.
*
* @param locale The country locale.
* @return the corresponding CurrencyUnit instance.
*/
public CurrencyUnit getProvidedCurrency(Locale locale){
throw new UnsupportedOperationException();
}
...
}
Describes
the task to
be done
(incl. Some
hints)
Replace this
with
according
code
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Adoption Areas JSR 354 – The Easy Way
API Challenge: MoneyMachine Testing
32
To check your
implementation is correct,
simply execute the test suite
Correct ;-)
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Adoption Areas JSR 354 - Medium
Extending the Reference Implementation
33
Objective: Extend the RI
How:
Discuss your ideas with me to see where your idea fits
best
Additional Roundings
Additional Currencies
Additional Exchange Rate Providers
Additional Formats
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Adoption Areas JSR 354 - Medium
Documenting the Reference Implementation
34
Objective: Document the RI (user guide)
How:
Take a Topic
Write documentation (asciidoc)
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Adoption Areas JSR 354 – Medium Level
Helping on JavaMoney Library
35
Objective: Help on JavaMoney
How:
Financial calculations in calc need tests
Factor out Dataservice Layer
All Modules require check on JavaDocs, Tests
Enhance APIs with Java 8 features (e.g. 310 types)
Write/enhance user guide (asciidoc)
New functionalities, ideas?
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Adoption Areas JSR 354 – Medium Level
Help on the TCK
36
Objective: Help finalizing the TCK
How:
Write TCK tests (only a few missing)
Check Test Failure Messages
Check Test Semantics
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Adoption Areas JSR 354 – Medium Level
Helping on the TCK (continued)
37
/**
* Test successful conversion for possible currency pairs.<br/>
* Hint: you may only check for rate factory, when using a hardcoded
* ExchangeRateProvider, such a provider
* must be also implemented and registered as an SPI.
*/
@Test @SpecAssertion(id = "432-A1", section="4.3.2")
public void testConversion(){
Assert.fail();
}
Describes the test
very briefly
References the according
section in the spec
Add your test code here.
Hint 1: if you are unsure first write a story line
Hint 2: some aspects may require to implement multiple
tests, just ensure the annotations are on all tests
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Adoption Areas JSR 354 – The Hard Way
Analyze and Improve Performance
38
Objective: Improve Performance
How:
Measure Performance and Memory Consumption
Define corresponding improvement ideas
Implement improvements
Known aspects:
FastMoney implementation could be faster, especially for
division
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Adoption Areas JSR 354 – The Hard Way
Write an Overall Example Application
39
Objective: Implement a Deployable Example Application
How:
Define Application Storyline
Define Screens etc.
Implement everything needed
Deploy on CloudBees ?
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Adoption Areas JSR 354 – The Hard Way
Write an Implementation
40
Objective: Ensure Specification / API Quality
How:
Implement whole or parts of the specification
Check the implementation against the TCK
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Setup
41
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Setup
42
• Install VirtualBox, if not yet done, download from
https://www.virtualbox.org
• Download the prepared image and start it
• Login with debian/debian
• Open the IDE of your choice (Eclipse, IntelliJ and
Netbeans are preinstalled and setup)
• Update the projects/repositories
• For Contributors:
• Ensure you have a GitHub user account
• Create your own Branch of the corresponding repositories
• Switch your local repositories on your VM, on which you want to commit,
to your branched repos
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Q & A
43
Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014
Go for it!
44

More Related Content

What's hot

Web注入+http漏洞等描述
Web注入+http漏洞等描述Web注入+http漏洞等描述
Web注入+http漏洞等描述fangjiafu
 
JAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) BridgeJAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) BridgeJosé Paumard
 
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVMQCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVMPeter Pilgrim
 
Slice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed PersistenceSlice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed PersistencePinaki Poddar
 
Demystifying Oak Search
Demystifying Oak SearchDemystifying Oak Search
Demystifying Oak SearchJustin Edelson
 
Why You Should Use TAPIs
Why You Should Use TAPIsWhy You Should Use TAPIs
Why You Should Use TAPIsJeffrey Kemp
 
Innovation and Security in Ruby on Rails
Innovation and Security in Ruby on RailsInnovation and Security in Ruby on Rails
Innovation and Security in Ruby on Railstielefeld
 
Demystifying Drupal AJAX Callback Commands
Demystifying Drupal AJAX Callback CommandsDemystifying Drupal AJAX Callback Commands
Demystifying Drupal AJAX Callback CommandsMichael Miles
 
Mastering the Sling Rewriter
Mastering the Sling RewriterMastering the Sling Rewriter
Mastering the Sling RewriterJustin Edelson
 
Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...
Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...
Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...Lucas Jellema
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghStuart Roebuck
 
Moving from JFreeChart to JavaFX with JavaFX Chart Extensions
Moving from JFreeChart to JavaFX with JavaFX Chart ExtensionsMoving from JFreeChart to JavaFX with JavaFX Chart Extensions
Moving from JFreeChart to JavaFX with JavaFX Chart ExtensionsBruce Schubert
 
Core Php Component Presentation
Core Php Component PresentationCore Php Component Presentation
Core Php Component PresentationJohn Coonen
 
Back to the basics: Modelando nuestro dominio #scbcn19
Back to the basics: Modelando nuestro dominio #scbcn19Back to the basics: Modelando nuestro dominio #scbcn19
Back to the basics: Modelando nuestro dominio #scbcn19CodelyTV
 
Greach 2019 - Creating Micronaut Configurations
Greach 2019 - Creating Micronaut ConfigurationsGreach 2019 - Creating Micronaut Configurations
Greach 2019 - Creating Micronaut ConfigurationsIván López Martín
 
Redis for your boss 2.0
Redis for your boss 2.0Redis for your boss 2.0
Redis for your boss 2.0Elena Kolevska
 

What's hot (20)

Web注入+http漏洞等描述
Web注入+http漏洞等描述Web注入+http漏洞等描述
Web注入+http漏洞等描述
 
JAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) BridgeJAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) Bridge
 
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVMQCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
 
Slice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed PersistenceSlice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed Persistence
 
Demystifying Oak Search
Demystifying Oak SearchDemystifying Oak Search
Demystifying Oak Search
 
Why You Should Use TAPIs
Why You Should Use TAPIsWhy You Should Use TAPIs
Why You Should Use TAPIs
 
Innovation and Security in Ruby on Rails
Innovation and Security in Ruby on RailsInnovation and Security in Ruby on Rails
Innovation and Security in Ruby on Rails
 
Demystifying Drupal AJAX Callback Commands
Demystifying Drupal AJAX Callback CommandsDemystifying Drupal AJAX Callback Commands
Demystifying Drupal AJAX Callback Commands
 
Getting Started-with-Laravel
Getting Started-with-LaravelGetting Started-with-Laravel
Getting Started-with-Laravel
 
Mastering the Sling Rewriter
Mastering the Sling RewriterMastering the Sling Rewriter
Mastering the Sling Rewriter
 
Spring data requery
Spring data requerySpring data requery
Spring data requery
 
The CoFX Data Model
The CoFX Data ModelThe CoFX Data Model
The CoFX Data Model
 
Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...
Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...
Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup Edinburgh
 
Moving from JFreeChart to JavaFX with JavaFX Chart Extensions
Moving from JFreeChart to JavaFX with JavaFX Chart ExtensionsMoving from JFreeChart to JavaFX with JavaFX Chart Extensions
Moving from JFreeChart to JavaFX with JavaFX Chart Extensions
 
Core Php Component Presentation
Core Php Component PresentationCore Php Component Presentation
Core Php Component Presentation
 
Back to the basics: Modelando nuestro dominio #scbcn19
Back to the basics: Modelando nuestro dominio #scbcn19Back to the basics: Modelando nuestro dominio #scbcn19
Back to the basics: Modelando nuestro dominio #scbcn19
 
Greach 2019 - Creating Micronaut Configurations
Greach 2019 - Creating Micronaut ConfigurationsGreach 2019 - Creating Micronaut Configurations
Greach 2019 - Creating Micronaut Configurations
 
Jstl Guide
Jstl GuideJstl Guide
Jstl Guide
 
Redis for your boss 2.0
Redis for your boss 2.0Redis for your boss 2.0
Redis for your boss 2.0
 

Viewers also liked

Wie Monolithen für die Zukuft trimmen
Wie Monolithen für die Zukuft trimmenWie Monolithen für die Zukuft trimmen
Wie Monolithen für die Zukuft trimmenAnatole Tresch
 
Manuel ponce
Manuel ponceManuel ponce
Manuel poncePvilla66
 
Configuration with Apache Tamaya
Configuration with Apache TamayaConfiguration with Apache Tamaya
Configuration with Apache TamayaAnatole Tresch
 
Configure Your Projects with Apache Tamaya
Configure Your Projects with Apache TamayaConfigure Your Projects with Apache Tamaya
Configure Your Projects with Apache TamayaAnatole Tresch
 
Configure once, run everywhere 2016
Configure once, run everywhere 2016Configure once, run everywhere 2016
Configure once, run everywhere 2016Anatole Tresch
 

Viewers also liked (6)

Wie Monolithen für die Zukuft trimmen
Wie Monolithen für die Zukuft trimmenWie Monolithen für die Zukuft trimmen
Wie Monolithen für die Zukuft trimmen
 
Manuel ponce
Manuel ponceManuel ponce
Manuel ponce
 
Configuration with Apache Tamaya
Configuration with Apache TamayaConfiguration with Apache Tamaya
Configuration with Apache Tamaya
 
Configure Your Projects with Apache Tamaya
Configure Your Projects with Apache TamayaConfigure Your Projects with Apache Tamaya
Configure Your Projects with Apache Tamaya
 
Configure once, run everywhere 2016
Configure once, run everywhere 2016Configure once, run everywhere 2016
Configure once, run everywhere 2016
 
Going Resilient...
Going Resilient...Going Resilient...
Going Resilient...
 

Similar to JSR 354 LJC-Hackday

JSR 354 Hackday - What you can do...
JSR 354 Hackday - What you can do...JSR 354 Hackday - What you can do...
JSR 354 Hackday - What you can do...Anatole Tresch
 
Go for the Money - JSR 354
Go for the Money - JSR 354Go for the Money - JSR 354
Go for the Money - JSR 354Anatole Tresch
 
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 OverviewWerner Keil
 
JAZOON'13 - Anatole Tresch - Go for the money (JSR 354) !
JAZOON'13 - Anatole Tresch - Go for the money (JSR 354) !JAZOON'13 - Anatole Tresch - Go for the money (JSR 354) !
JAZOON'13 - Anatole Tresch - Go for the money (JSR 354) !jazoon13
 
Adopting F# at SBTech
Adopting F# at SBTechAdopting F# at SBTech
Adopting F# at SBTechAntya Dev
 
Week 8
Week 8Week 8
Week 8A VD
 
Introduction to JSR 354 (Currency and Money) by Anatole Tresch
Introduction to JSR 354 (Currency and Money) by Anatole TreschIntroduction to JSR 354 (Currency and Money) by Anatole Tresch
Introduction to JSR 354 (Currency and Money) by Anatole TreschCodemotion
 
JSR 354 - Money and Currency API
JSR 354 - Money and Currency APIJSR 354 - Money and Currency API
JSR 354 - Money and Currency APIRajmahendra Hegde
 
Vertical Recommendation Using Collaborative Filtering
Vertical Recommendation Using Collaborative FilteringVertical Recommendation Using Collaborative Filtering
Vertical Recommendation Using Collaborative Filteringgorass
 
JSR354 Utrecht JUG 20171027
JSR354 Utrecht JUG 20171027JSR354 Utrecht JUG 20171027
JSR354 Utrecht JUG 20171027Wim van Haaren
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Matt Raible
 
Reactive programming every day
Reactive programming every dayReactive programming every day
Reactive programming every dayVadym Khondar
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real worldAtul Chhoda
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real worldAtul Chhoda
 
Groovy On The Trading Desk
Groovy On The Trading DeskGroovy On The Trading Desk
Groovy On The Trading DeskJonathan Felch
 
Ruslan Platonov - Transactions
Ruslan Platonov - TransactionsRuslan Platonov - Transactions
Ruslan Platonov - TransactionsDmitry Buzdin
 
How to perform debounce in react
How to perform debounce in reactHow to perform debounce in react
How to perform debounce in reactBOSC Tech Labs
 

Similar to JSR 354 LJC-Hackday (20)

JSR 354 Hackday - What you can do...
JSR 354 Hackday - What you can do...JSR 354 Hackday - What you can do...
JSR 354 Hackday - What you can do...
 
Adopt JSR 354
Adopt JSR 354Adopt JSR 354
Adopt JSR 354
 
Go for the Money - JSR 354
Go for the Money - JSR 354Go for the Money - JSR 354
Go for the Money - JSR 354
 
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
 
JAZOON'13 - Anatole Tresch - Go for the money (JSR 354) !
JAZOON'13 - Anatole Tresch - Go for the money (JSR 354) !JAZOON'13 - Anatole Tresch - Go for the money (JSR 354) !
JAZOON'13 - Anatole Tresch - Go for the money (JSR 354) !
 
Adopting F# at SBTech
Adopting F# at SBTechAdopting F# at SBTech
Adopting F# at SBTech
 
Week 8
Week 8Week 8
Week 8
 
Introduction to JSR 354 (Currency and Money) by Anatole Tresch
Introduction to JSR 354 (Currency and Money) by Anatole TreschIntroduction to JSR 354 (Currency and Money) by Anatole Tresch
Introduction to JSR 354 (Currency and Money) by Anatole Tresch
 
JSR 354 - Money and Currency API
JSR 354 - Money and Currency APIJSR 354 - Money and Currency API
JSR 354 - Money and Currency API
 
Vertical Recommendation Using Collaborative Filtering
Vertical Recommendation Using Collaborative FilteringVertical Recommendation Using Collaborative Filtering
Vertical Recommendation Using Collaborative Filtering
 
JSR354 Utrecht JUG 20171027
JSR354 Utrecht JUG 20171027JSR354 Utrecht JUG 20171027
JSR354 Utrecht JUG 20171027
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
 
Reactive programming every day
Reactive programming every dayReactive programming every day
Reactive programming every day
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real world
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real world
 
Groovy On The Trading Desk
Groovy On The Trading DeskGroovy On The Trading Desk
Groovy On The Trading Desk
 
Ruslan Platonov - Transactions
Ruslan Platonov - TransactionsRuslan Platonov - Transactions
Ruslan Platonov - Transactions
 
F# And Silverlight
F# And SilverlightF# And Silverlight
F# And Silverlight
 
How to perform debounce in react
How to perform debounce in reactHow to perform debounce in react
How to perform debounce in react
 

More from Anatole Tresch

Jsr382: Konfiguration in Java
Jsr382: Konfiguration in JavaJsr382: Konfiguration in Java
Jsr382: Konfiguration in JavaAnatole Tresch
 
Wie man Applikationen nicht bauen sollte...
Wie man Applikationen nicht bauen sollte...Wie man Applikationen nicht bauen sollte...
Wie man Applikationen nicht bauen sollte...Anatole Tresch
 
The Gib Five - Modern IT Architecture
The Gib Five - Modern IT ArchitectureThe Gib Five - Modern IT Architecture
The Gib Five - Modern IT ArchitectureAnatole Tresch
 
The Big Five - IT Architektur Heute
The Big Five - IT Architektur HeuteThe Big Five - IT Architektur Heute
The Big Five - IT Architektur HeuteAnatole Tresch
 
Disruption is Change is Future
Disruption is Change is FutureDisruption is Change is Future
Disruption is Change is FutureAnatole Tresch
 
Configuration with Microprofile and Apache Tamaya
Configuration with Microprofile and Apache TamayaConfiguration with Microprofile and Apache Tamaya
Configuration with Microprofile and Apache TamayaAnatole Tresch
 
Configuration beyond Java EE 8
Configuration beyond Java EE 8Configuration beyond Java EE 8
Configuration beyond Java EE 8Anatole Tresch
 
Alles Docker oder Was ?
Alles Docker oder Was ?Alles Docker oder Was ?
Alles Docker oder Was ?Anatole Tresch
 
Legacy Renewal of Central Framework in the Enterprise
Legacy Renewal of Central Framework in the EnterpriseLegacy Renewal of Central Framework in the Enterprise
Legacy Renewal of Central Framework in the EnterpriseAnatole Tresch
 
Go for the Money: eine Einführung in JSR 354 - Java aktuell 2014 - Anatole Tr...
Go for the Money: eine Einführung in JSR 354 - Java aktuell 2014 - Anatole Tr...Go for the Money: eine Einführung in JSR 354 - Java aktuell 2014 - Anatole Tr...
Go for the Money: eine Einführung in JSR 354 - Java aktuell 2014 - Anatole Tr...Anatole Tresch
 
A first Draft to Java Configuration
A first Draft to Java ConfigurationA first Draft to Java Configuration
A first Draft to Java ConfigurationAnatole Tresch
 

More from Anatole Tresch (12)

Jsr382: Konfiguration in Java
Jsr382: Konfiguration in JavaJsr382: Konfiguration in Java
Jsr382: Konfiguration in Java
 
Wie man Applikationen nicht bauen sollte...
Wie man Applikationen nicht bauen sollte...Wie man Applikationen nicht bauen sollte...
Wie man Applikationen nicht bauen sollte...
 
The Gib Five - Modern IT Architecture
The Gib Five - Modern IT ArchitectureThe Gib Five - Modern IT Architecture
The Gib Five - Modern IT Architecture
 
The Big Five - IT Architektur Heute
The Big Five - IT Architektur HeuteThe Big Five - IT Architektur Heute
The Big Five - IT Architektur Heute
 
Microservices in Java
Microservices in JavaMicroservices in Java
Microservices in Java
 
Disruption is Change is Future
Disruption is Change is FutureDisruption is Change is Future
Disruption is Change is Future
 
Configuration with Microprofile and Apache Tamaya
Configuration with Microprofile and Apache TamayaConfiguration with Microprofile and Apache Tamaya
Configuration with Microprofile and Apache Tamaya
 
Configuration beyond Java EE 8
Configuration beyond Java EE 8Configuration beyond Java EE 8
Configuration beyond Java EE 8
 
Alles Docker oder Was ?
Alles Docker oder Was ?Alles Docker oder Was ?
Alles Docker oder Was ?
 
Legacy Renewal of Central Framework in the Enterprise
Legacy Renewal of Central Framework in the EnterpriseLegacy Renewal of Central Framework in the Enterprise
Legacy Renewal of Central Framework in the Enterprise
 
Go for the Money: eine Einführung in JSR 354 - Java aktuell 2014 - Anatole Tr...
Go for the Money: eine Einführung in JSR 354 - Java aktuell 2014 - Anatole Tr...Go for the Money: eine Einführung in JSR 354 - Java aktuell 2014 - Anatole Tr...
Go for the Money: eine Einführung in JSR 354 - Java aktuell 2014 - Anatole Tr...
 
A first Draft to Java Configuration
A first Draft to Java ConfigurationA first Draft to Java Configuration
A first Draft to Java Configuration
 

Recently uploaded

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 

Recently uploaded (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 

JSR 354 LJC-Hackday

  • 1. Go for the Money JSR 354 Hackday London Java Community 2014 June 2014 Go for the money –JSR 354 Hackday http://java.net/projects/javamoney
  • 2. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Bio Anatole Tresch Consultant, Coach Credit Suisse Technical Coordinator & Architect Specification Lead JSR 354 Regular Conference Speaker Driving Java EE Config Twitter/Google+: @atsticks atsticks@java.net anatole.tresch@credit-suisse.com Java Config Discussion https://groups.google.com/forum/#!forum/java-config Java Config Blog: http://javaeeconfig.blogspot.ch Zurich Java Community (Google Community) Zurich Hackergarten 2
  • 3. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Agenda 3 Introduction Possible Topics Easy: API Challenge: Moneymachine Medium: Adding functonalities to the RI, e.g. Special Roundings BitCoin and other currencies Test Financial Formulas in JavaMoney Hard Improve FastMoney Measure CPU and Memory Consumption Write a Complex Integration Sample Setup
  • 4. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Introduction javax.money 4
  • 5. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Currencies API 5 Allow currencies with arbitrary other currency codes Register additional Currency Units using an flexible SPI Fluent API using a Builder (RI only) (Historic Validity of currencies related to regions/countries and vice versa (not part of JSR, but javamoney OSS project)) public interface CurrencyUnit{ public String getCurrencyCode(); public int getNumericCode(); public int getDefaultFractionDigits(); } public final class MonetaryCurrencies{ public CurrencyUnit getCurrency(String currencyCode); public CurrencyUnit getCurrency(Locale locale); public boolean isCurrencyAvailable(String currencyCode); public boolean isCurrencyAvailable(String locale); }
  • 6. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Currencies (continued) API Samples CurrencyUnit currency1 = MonetaryCurrencies.getCurrency("USD"); CurrencyUnit currency2 = MonetaryCurrencies.getCurrency( Locale.GERMANY); CurrencyUnit bitcoin = new BuildableCurrencyUnit.Builder("BTC") .setNumericCode(123456) .setDefaultFractionDigits(8) .create(); 6 Access a CurrencyUnit Build a CurrencyUnit (RI only) Register a CurrencyUnit CurrencyUnit bitcoin = ….create(true);
  • 7. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Monetary Amounts General Aspects 7 Amount = Currency + Numeric Value + Capabilities Arithmetic Functions, Comparison Fluent API Functional design for extendible functionality (MonetaryOperator, MonetaryQuery)
  • 8. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Monetary Amounts (continued) Key Decisions 8 Support Several Numeric Representations (instead of one single fixed value type) Define Implementation Recommendations • Rounding should to be modelled as separate concern (a MonetaryOperator) • Ensure Interoperability by the MonetaryAmount interface • Precision/scale capabilities should be inherited to its operational results.
  • 9. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Monetary Amounts (continued) The API public interface MonetaryAmount{ public CurrencyUnit getCurrency(); public NumberValue getNumber(); public MonetaryContext getMonetaryContext(); public MonetaryAmount with(MonetaryOperator operator); public <R> R query(MonetaryQuery<R> query); public MonetaryAmountFactory<? extends MonetaryAmount> getFactory(); … public boolean isLessThanOrEqualTo(MonetaryAmount amt); public boolean isLessThan(MonetaryAmount amt); public boolean isEqualTo(MonetaryAmount amt); public int signum(); … public MonetaryAmount add(MonetaryAmount amount); public MonetaryAmount subtract(MonetaryAmount amount); public MonetaryAmount divide(long number); public MonetaryAmount multiply(Number number); public MonetaryAmount remainder(double number); … public MonetaryAmount stripTrailingZeros(); } 9
  • 10. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Monetary Context Modeling Amount Capabilities 10 Describes the capabilities of a MonetaryAmount. Accessible from each MonetaryAmount instance. Allows querying a feasible implementation type from MonetaryAmounts. Contains common aspects Max precision, max scale, implementation type Arbitrary attributes E.g. RoundingMode, MathContext, …
  • 11. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Monetary Context (continued) The API public final class MonetaryContext extends AbstractContext implements Serializable { public int getPrecision(); public int getMaxScale(); public Class<? extends MonetaryAmount> getAmountType(); public static final class Builder{…} } public abstract class AbstractContext implements Serializable{ … public <T> T getNamedAttribute(Class<T> type, Object key, T defaultValue); public <T> T getNamedAttribute(Class<T> type, Object key); public <T> T getAttribute(Class<T> type, T defaultValue); public <T> T getAttribute(Class<T> type); public Set<Class<?>> getAttributeTypes(); } 11
  • 12. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Creating Monetary Amounts Monetary Amount Factory 12 Creates new instances of MonetaryAmount. Declares The concrete MonetaryAmount implementation type returned. The min/max MonetaryContext supported. Can be configured with a target CurrencyUnit A numeric value MonetaryContext.
  • 13. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Creating Monetary Amounts (continued) Monetary Amount Factory public interface MonetaryAmountFactory<T extends MonetaryAmount> { Class<? extends MonetaryAmount> getAmountType(); MonetaryAmountFactory<T> setCurrency(String currencyCode); MonetaryAmountFactory<T> setCurrency(CurrencyUnit currency); MonetaryAmountFactory<T> setNumber(double number); MonetaryAmountFactory<T> setNumber(long number); MonetaryAmountFactory<T> setNumber(Number number); MonetaryAmountFactory<T> setContext(MonetaryContext monetaryContext); MonetaryAmountFactory<T> setAmount(MonetaryAmount amount); MonetaryContext getDefaultMonetaryContext(); MonetaryContext getMaximalMonetaryContext(); T create(); } 13
  • 14. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Creating Monetary Amounts Usage Samples // Using the default type MonetaryAmount amount1 = MonetaryAmounts.getAmountFactory() .setCurrency("USD“) .setNumber(1234566.15) .create(); // Using an explicit type Money amount2 = MonetaryAmounts.getAmountFactory(Money.class) .setCurrency("USD“) .setNumber(1234566.15) .create(); // Query a matching implementation type MonetaryContext monCtx = new MonetaryContext.Builder() .setAmountFlavor( AmountFlavor.PERFORMANT) .create(); Class<? extends MonetaryAmount> type = MonetaryAmounts.queryAmontType( monCtx); MonetaryAmountFactory<?> fact = MonetaryAmounts.queryAmountFactory( monCtx); 14
  • 15. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Extension Points MonetaryOperator  Takes an amount and procudes some other amount. • With different value • With different currency • Or both // @FunctionalInterface public interface MonetaryOperator { public MonetaryAmount apply(MonetaryAmount amount); } • Operators then can be applied on every MonetaryAmount: public interface MonetaryAmount{ … public MonetaryAmount with (MonetaryOperator operator); … } 15
  • 16. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Extension Points (continued) MonetaryOperator: Use Cases Extend the algorithmic capabilities • Percentages • Permil • Different Minor Units • Different Major Units • Rounding • Currency Conversion • Financial Calculations • … 16
  • 17. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Extension Points (continued) MonetaryOperator Example: Rounding and Percentage 17 // round an amount MonetaryOperator rounding = MoneyRoundings.getRounding( MonetaryCurrencies.getCurrency(“USD”)); Money amount = Money.of(“USD”, 12.345567); Money rounded = amount.with(rounding); // USD 12.35 // MonetaryFunctions, e.g. calculate 3% of it Money threePercent = rounded.with( MonetaryFunctions.getPercent(3)); // USD 0.3705
  • 18. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Extension Points (continued) MonetaryQuery  A MonetaryQuery takes an amount and procuces an arbitrary result: // @FunctionalInterface public interface MonetaryQuery<T> { public T queryFrom(MonetaryAmount amount); }  Queries then can be applied on every MonetaryAmount: public interface MonetaryAmount { … public <T> T query (MonetaryQuary<T> query); … } 18
  • 19. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Currency Conversion javax.money.convert.* 19
  • 20. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Currency Conversion ExchangeRate  A ExchangeRate models a conversion between two currencies: • Base CurrencyUnit • Terminating/target CurrencyUnit • Provider • Conversion Factor, where M(term) = M(base) * f • Additional attributes (ConversionContext) • Rate chain (composite rates)  Rates may be direct or derived (composite rates) 20
  • 21. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Currency Conversion ExchangeRateProvider // access default provider (chain) ExchangeRateProvider prov = MonetaryConversions.getExchangeRateProvider(); // access a provider explicitly prov = MonetaryConversions.getExchangeRateProvider("IMF"); // access explicit provider chain prov = MonetaryConversions.getExchangeRateProvider("ECB", "IMF"); // access Exchange rates ExchangeRate rate = provider.getExchangeRate("EUR", "CHF"); // Passing additional parameters ExchangeRate rate = provider.getExchangeRate("EUR", "CHF", ConversionContext.of( System.currentTimeMillis() + 2000L) ); 21Go for the money - JSR 354 - http://java.net/projects/javamoney
  • 22. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Currency Conversion (continued) Performing Conversion Accessing a CurrencyConversion (always targeted to a terminating CurrencyUnit): // access from a ExchangeRateProvider ExchangeRateProvider prov = …; CurrencyConversion conv = prov.getCurrencyConversion("INR"); // access it directly (using default rate chain) conv = MonetaryConversions.getConversion("INR"); // access it, using explicit provider chain conv = MonetaryConversions.getConversion("INR", "ECB", "IMF"); Performing conversion: MonetaryAmount chfAmount = MonetaryAmounts.of("CHF",10.50); MonetaryAmount inrAmount = chfAmount.with(conv); // around EUR 8.75 22
  • 23. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Formatting and Parsing javax.money.format.* 23
  • 24. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Formatting and Parsing MonetaryAmountFormat Similar to java.text.DecimalFormat accessible by Locale Configured by AmountFormatContext Supports also custom formats (configured an accessed using AmountFormatContext) Building AmountFormatContext using a fluent API Thread safe! 24Go for the money - JSR 354 - http://java.net/projects/javamoney
  • 25. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Formatting and Parsing (continued) MonetaryAmountFormat: Usage Example // Access a provided format MonetaryAmountFormat format = MonetaryFormats.getAmountFormat( new Locale(“”, “in”)); System.out.println(format.format( Money.of("INR", 39101112.123456)))); -> INR 3,91,01,112.10 // Access a custom format MonetaryAmountFormat format = MonetaryFormats.getAmountFormat( AmountFormatContext.of(“myCustomFormat”)); 25Go for the money - JSR 354 - http://java.net/projects/javamoney
  • 26. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 JavaMoney OSS Project org.javamoney.* 26
  • 27. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 JavaMoney OSS Project Extended Currency Services  Currency namespaces (e.g. ISO, VIRTUAL, …)  Currency namespace mapping Validity Services (Historization API) • access of historic currency data related to regions Region Services  Region Forest • Unicode CLDR region tree • ISO 2-, 3-letter countries • Custom Trees Extendible token-based Formatting API Financial Calculations & Formulas 27
  • 28. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Links Current Spec (work in progress, comments allowed): https://docs.google.com/document/d/1FfihURoCYrbkDcSf1W XM6fHoU3d3tKooMnZLCpmpyV8/edit GitHub Project (JSR and JavaMoney): https://github.com/JavaMoney/javamoney Umbrella Page: http://javamoney.org JSR 354: http://jcp.org Java.net Project: http://java.net/projects/javamoney JUG Chennai Adoption (TrakStok): https://github.com/jugchennaiadoptjava/TrakStok Twitter: @jsr354 Cash Rounding: http://en.wikipedia.org/wiki/Swedish_rounding 28
  • 29. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 HackDay - Possible Topics 29 Easy - Money Machine Medium - Extending RI - RI User Guide - JavaMoney Lib - TCK Hard - L & P - Create Sample App - Implement a RI
  • 30. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Adoption Areas JSR 354 – The Easy Way API Challenge: MoneyMachine 30 Objective: Test the API for usability, make proposals to improve How: Checkout/update the MoneyMachine project from https://github.com/atsticks/moneymachine.git Implement the classes in the src/main/java to make the tests green (skeletons are already there) The challenge will guide you throughout the whole JSR Overall 40+ test cases of different complexity (easy to medium), you may also select only a subset ;-) Add improvement proposals to the JSRs JIRA on java.net Blog your (hopefully positive) experience, twitter, …
  • 31. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Adoption Areas JSR 354 – The Easy Way API Challenge: MoneyMachine Example 31 /** * This class has to be implemented and helps us giving feedback on the JSR's API. This * part of the * project deals with basic aspects such as getting currencies and amounts. * Created by Anatole on 07.03.14. */ public class Basics{ /** * Get a CurrencyUnit using a currency code. * * @param currencyCode the currency code * @return the corresponding CurrencyUnit instance. */ public CurrencyUnit getProvidedCurrency(String currencyCode){ throw new UnsupportedOperationException(); } /** * Get a CurrencyUnit using a Locale, modeling a country. * * @param locale The country locale. * @return the corresponding CurrencyUnit instance. */ public CurrencyUnit getProvidedCurrency(Locale locale){ throw new UnsupportedOperationException(); } ... } Describes the task to be done (incl. Some hints) Replace this with according code
  • 32. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Adoption Areas JSR 354 – The Easy Way API Challenge: MoneyMachine Testing 32 To check your implementation is correct, simply execute the test suite Correct ;-)
  • 33. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Adoption Areas JSR 354 - Medium Extending the Reference Implementation 33 Objective: Extend the RI How: Discuss your ideas with me to see where your idea fits best Additional Roundings Additional Currencies Additional Exchange Rate Providers Additional Formats
  • 34. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Adoption Areas JSR 354 - Medium Documenting the Reference Implementation 34 Objective: Document the RI (user guide) How: Take a Topic Write documentation (asciidoc)
  • 35. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Adoption Areas JSR 354 – Medium Level Helping on JavaMoney Library 35 Objective: Help on JavaMoney How: Financial calculations in calc need tests Factor out Dataservice Layer All Modules require check on JavaDocs, Tests Enhance APIs with Java 8 features (e.g. 310 types) Write/enhance user guide (asciidoc) New functionalities, ideas?
  • 36. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Adoption Areas JSR 354 – Medium Level Help on the TCK 36 Objective: Help finalizing the TCK How: Write TCK tests (only a few missing) Check Test Failure Messages Check Test Semantics
  • 37. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Adoption Areas JSR 354 – Medium Level Helping on the TCK (continued) 37 /** * Test successful conversion for possible currency pairs.<br/> * Hint: you may only check for rate factory, when using a hardcoded * ExchangeRateProvider, such a provider * must be also implemented and registered as an SPI. */ @Test @SpecAssertion(id = "432-A1", section="4.3.2") public void testConversion(){ Assert.fail(); } Describes the test very briefly References the according section in the spec Add your test code here. Hint 1: if you are unsure first write a story line Hint 2: some aspects may require to implement multiple tests, just ensure the annotations are on all tests
  • 38. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Adoption Areas JSR 354 – The Hard Way Analyze and Improve Performance 38 Objective: Improve Performance How: Measure Performance and Memory Consumption Define corresponding improvement ideas Implement improvements Known aspects: FastMoney implementation could be faster, especially for division
  • 39. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Adoption Areas JSR 354 – The Hard Way Write an Overall Example Application 39 Objective: Implement a Deployable Example Application How: Define Application Storyline Define Screens etc. Implement everything needed Deploy on CloudBees ?
  • 40. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Adoption Areas JSR 354 – The Hard Way Write an Implementation 40 Objective: Ensure Specification / API Quality How: Implement whole or parts of the specification Check the implementation against the TCK
  • 41. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Setup 41
  • 42. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Setup 42 • Install VirtualBox, if not yet done, download from https://www.virtualbox.org • Download the prepared image and start it • Login with debian/debian • Open the IDE of your choice (Eclipse, IntelliJ and Netbeans are preinstalled and setup) • Update the projects/repositories • For Contributors: • Ensure you have a GitHub user account • Create your own Branch of the corresponding repositories • Switch your local repositories on your VM, on which you want to commit, to your branched repos
  • 43. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Q & A 43
  • 44. Go for the money - JSR 354 - http://java.net/projects/javamoney March 2014 Go for it! 44