SlideShare a Scribd company logo
How JSR-385 could have
Saved the Mars Climate
Orbiter
Werner Keil & Thodoris Bais
@thodorisbais@wernerkeil
@thodorisbais@wernerkeil
https://hobbylark.com/party-games/1999-Fun-Facts-Trivia-and-News
@thodorisbais@wernerkeil
https://hobbylark.com/party-games/1999-Fun-Facts-Trivia-and-News
Mars Climate
Orbiter
• Launched on 11
December 1998

• 338 kilograms

• $125 millions

• To study Martian
climate, atmosphere
and surface changes
@thodorisbais@wernerkeil
Result of the Mission
@thodorisbais@wernerkeil
What went wrong
@thodorisbais@wernerkeil
lbf·s N·s4.45
@thodorisbais@wernerkeil
Mars Climate Orbiter
“The problem here was not the error; it was the
failure of NASA’s systems engineering, and the
checks and balances in our process, to detect the
error. That’s why we lost the spacecraft.”
Edward Weiler

NASA associate administrator of space science,

IEEE Spectrum: Why the Mars Probe went off course
@thodorisbais@wernerkeil
Lessons Learned
@thodorisbais@wernerkeil
•Read the software specifications
•Use JSR-385 instead of primitives
•Fail-fast
More unit mishaps
@thodorisbais@wernerkeil
Problem Statement
@thodorisbais@wernerkeil
What is the Fundamental
Problem?
Primitive (Java) types are primitive types
@thodorisbais@wernerkeil
What is the Fundamental Problem?
Primitive (Java) types are primitive types
• static final double C = 1079252849;

• static final double SPEED_OF_LIGHT = 1079252849;

• static final double SPEED_OF_LIGHT_IN_KM_PER_H = 1079252849;
@thodorisbais@wernerkeil
static final Quantity<SPEED> SPEED_OF_LIGHT =
Quantities.getQuantity(1079252849, Units.KILOMETRE_PER_HOUR);
Rolling your Own Library
• Development
• Maintenance
• Upgrades & extensions
@thodorisbais@wernerkeil
Werner Keil Thodoris Bais
Spec Lead JSR-385 Expert Group Member JSR-385
Let’s meet
@thodorisbais@wernerkeil
What is JSR-385?
@thodorisbais@wernerkeil
@thodorisbais@wernerkeil
JSR-385: Units of
Measurement API 2.0
JSR-363 Modularity
Support Java SE >=8
JSR-385 Basic Concepts
• Dimensions

• Units

• Quantities

• Prefixes

• Converters

• Formats

• Systems of units
@thodorisbais@wernerkeil
Exercise
@thodorisbais@wernerkeil
Write a program to calculate the BMI of a person
Exercise description
BMI is a person's weight in kilograms (kg) divided by his or her height in meters squared
@thodorisbais@wernerkeil
Setting up a project
<dependencies>
<dependency>
<groupId>tech.units</groupId>
<artifactId>indriya</artifactId>
<version>2.0.1</version>
</dependency>
</dependencies>
@thodorisbais@wernerkeil
@thodorisbais@wernerkeil
Quantities
–Wikipedia
“A physical quantity is a physical property of a phenomenon, body,
or substance, that can be quantified by measurement.”
Definition of a Physical Quantity
@thodorisbais@wernerkeil
Speed of Light
c = 299,792,458 m/s
Value Unit
@thodorisbais@wernerkeil
One more quote
@thodorisbais@wernerkeil
–Ibidem
“The same physical quantity can be represented equivalently in many unit
systems.”
Speed of Light
c = 299,792,458 m/s
= 1,079,252,849 km/h
@thodorisbais@wernerkeil
1. Define two quantities

a. A mass

b. A length

2. Print them out
Exercise Time
@thodorisbais@wernerkeil
•Divide the mass by the square of the height

•Print out the result
Exercise Time
@thodorisbais@wernerkeil
@thodorisbais@wernerkeil
Units
Base Units
@thodorisbais@wernerkeil
Derived Units
@thodorisbais@wernerkeil
Multiples
• km

• ms

• Mm?

• ks?
@thodorisbais@wernerkeil
@thodorisbais@wernerkeil
Dimensions
Dimensions
• L: length

• T: time

• M: mass

• I: electric current

• Θ: thermodynamic temperature

• N: amount of substance

• J: luminous intensity

• (1)
Force: L · M · T-2
@thodorisbais@wernerkeil
Summary Table
@thodorisbais@wernerkeil
Doing the Maths
@thodorisbais@wernerkeil
Equality and Equivalence
• kΩ ≠ mHz

• kΩ ≠ mΩ

• kΩ ≡ kΩ

• N ≅ kg·m·s-2

• kg·m-2 ≅ mg·mm-2
• 1 kΩ ≠ 1 mHz

• 1 kΩ ≠ 1 mΩ

• 1 kΩ ≡ 1 kΩ

• 1 N ≅ 1 kg·m·s-2

• 1 kg·m-2 ≅ 1 mg·mm-2

• 1 kΩ ≅ 1,000 Ω
Units Quantities
@thodorisbais@wernerkeil
Quantity Addition
• 1 Ω + 1 Ω = 2 Ω

• 1 Ω + 1 mΩ = 1.001 Ω

• 1 mΩ + 1 Ω = 1,001 mΩ

• 1 Ω + 1 m “does not compile”
@thodorisbais@wernerkeil
DevoxxUA School
November Exam on Maths
How much is 0 °C + 0 °C?
• 0 °C
• 0 °C
• 273.15 °C
Two absolute temperatures
0 °C + 0 °C = 273.15K + 273.15K
= 546.30K
= 273.15 °C
@thodorisbais@wernerkeil
How much is 0 °C + 0 °C?
• 0 °C
• 0 °C
• 273.15 °C
An absolute temperature and a temperature change
0 °C + 0 °C = 273.15K + 0K
= 273.15K
= 0 °C
@thodorisbais@wernerkeil
DevoxxUA School
November Exam on Maths
How much is 0 °C + 0 °C?
• 0 °C
• 0 °C
• 273.15 °C
Two temperature changes
0 °C + 0 °C = 0K + 0K
= 0K
= 0 °C
@thodorisbais@wernerkeil
DevoxxUA School
November Exam on Maths
How much is 0 °C + 0 °C?
273.15 °C (546.30 K)
0 °C + 0 °C = 0 °C (273.15 K)
0 °C (0 K)
Answer
@thodorisbais@wernerkeil
DevoxxUA School
November Exam on Maths
Multiplication
Units
•kg × m = kg·m
•kg × mm = kg·mm
•g × km = g·km ≟ kg·m
•m × m = m2
•km × km = km2
•mm × km = mm·km ≟ m2
•µm × m = µm·m ≟ mm2
Quantities
•2 kg × 3 m = 6 kg·m
@thodorisbais@wernerkeil
DevoxxUA School
November Exam on Maths
Division
Units
•kg / m = kg·m-1
•kg / mm = kg·mm-1
•g / mm = g·mm-1 ≟ kg·m-1
•m2 / m = m
•m / m = 1
•km / km = 1
•km / m = km/m ≟ 1k
Quantities
• 3 kg / 2 m = 1.5 kg·m-1
@thodorisbais@wernerkeil
DevoxxUA School
November Exam on Maths
Powers
Units
•(m)2 = m2

•(km)2 = km2
•(m2)2 = m4
Quantities
• (3 m)2 = 9 m2
•
@thodorisbais@wernerkeil
DevoxxUA School
November Exam on Maths
Celsius Revisited
Units
•(K)2 = K2

•(°C)2 ≟ (K - 273.15)2
•m × °C ≟ m·(K - 273.15)
Quantities
•0 °C2 ≟ 74,610.9225 K2
•1 m°C ≟ 1 mK or 273.151K
@thodorisbais@wernerkeil
DevoxxUA School
November Exam on Maths
Parsing Units & Quantities
•299,792,458 m/s

•299792458 m/s

•299792.458 km/s

•299,792.458 km/s

•299,792,458 km*s-1

• 299,792.458 km×s-1
•299,792.458 km·s-1

•299,792.458 km·s⁻¹

•299,792.458 km*s^-1

•1,079,252,849 km/h

•1,079,252,849 km/t
• 670,616,629 mph
Speed of Light
@thodorisbais@wernerkeil
Systems of Unit
Systems of UnitSystems of Unit
• Metric System
• Imperial System
• US customary units
• Roman units of measurement
•Norwegian Units of Measurement
@thodorisbais@wernerkeil
Demo Time
@thodorisbais@wernerkeil
What Was the Fundamental
Problem Again?
Primitive (Java) types are primitive types
@thodorisbais@wernerkeil
JSR-385 Current Status
• JCP page

• https://jcp.org/en/jsr/detail?id=385

• GitHub repositories

• https://github.com/unitsofmeasurement

• Current status

• Final Release
@thodorisbais@wernerkeil
Java Community Process
@thodorisbais@wernerkeil
@thodorisbais@wernerkeil
We’re running for an Associate Seat!
Becoming a JCP Member
@thodorisbais@wernerkeil
@thodorisbais@wernerkeil

More Related Content

PDF
How JSR 385 could have Saved the Mars Climate Orbiter JFall 2019
PDF
How JSR 385 could have Saved the Mars Climate Orbiter CodeMotion Milan Octobe...
PDF
How JSR 385 Could have Saved the Mars Climate Orbiter JCON September 2019
PPTX
How JSR 385 could have Saved the Mars Climate Orbiter Java Global Summit 2020
PDF
How JSR 385 could have Saved the Mars Climate Orbiter Adorsys 2020
PPTX
Unit 1 notes_pp_12_13
PPT
Mass vs. weight
PPTX
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
How JSR 385 could have Saved the Mars Climate Orbiter JFall 2019
How JSR 385 could have Saved the Mars Climate Orbiter CodeMotion Milan Octobe...
How JSR 385 Could have Saved the Mars Climate Orbiter JCON September 2019
How JSR 385 could have Saved the Mars Climate Orbiter Java Global Summit 2020
How JSR 385 could have Saved the Mars Climate Orbiter Adorsys 2020
Unit 1 notes_pp_12_13
Mass vs. weight
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021

What's hot (6)

PPTX
Measurement
PPT
Project[1]
PPT
Physics – Unit and Measurement
PPTX
Fundamental Physics
DOC
#20 Key
PPTX
DNPnuclrsrchposter2012
Measurement
Project[1]
Physics – Unit and Measurement
Fundamental Physics
#20 Key
DNPnuclrsrchposter2012
Ad

Similar to How JSR 385 could have Saved the Mars Climate Orbiter DevoxxUA 2019 (20)

PPTX
How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020
PPTX
How JSR 385 Could have Saved the Mars Climate Orbiter DWX June 2019
PDF
How JSR-385 Could Have Saved the Mars Climate Orbiter
PPTX
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
PDF
How JSR 385 could have saved the Mars Climate Orbiter
PPTX
PRIMERA LEY DE NEWTON
PPT
Sci 111 math
PPTX
Physical Quantities--Units and Measurement--Conversion of Units
PDF
measurement-200427061108.pdf
PPTX
Quantities, Units, Order of Magnitude, Estimations.pptx
PPTX
Physical Quantities and Measurements
PPTX
Quarter 1 Lesson 1 - Physical Quantities and Measurements
PPT
Math of physics
PPT
AS-0-General physics vernier calipers.ppt
PPTX
Units of measurement in general physics 1
PDF
Physics for Scientists and Engineers with Modern Physics 9th Edition Raymond ...
PDF
units and dimensions
PDF
Exams on science,
PDF
WEEK-3-CHAPTER-2.-Measurements.pdfhsgsjshdhsbshzjjsjskskzkzjdhx
PPTX
6TH CHAPTER -2 PHYSICAL QUANTITIES and measurement.pptx
How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020
How JSR 385 Could have Saved the Mars Climate Orbiter DWX June 2019
How JSR-385 Could Have Saved the Mars Climate Orbiter
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
How JSR 385 could have saved the Mars Climate Orbiter
PRIMERA LEY DE NEWTON
Sci 111 math
Physical Quantities--Units and Measurement--Conversion of Units
measurement-200427061108.pdf
Quantities, Units, Order of Magnitude, Estimations.pptx
Physical Quantities and Measurements
Quarter 1 Lesson 1 - Physical Quantities and Measurements
Math of physics
AS-0-General physics vernier calipers.ppt
Units of measurement in general physics 1
Physics for Scientists and Engineers with Modern Physics 9th Edition Raymond ...
units and dimensions
Exams on science,
WEEK-3-CHAPTER-2.-Measurements.pdfhsgsjshdhsbshzjjsjskskzkzjdhx
6TH CHAPTER -2 PHYSICAL QUANTITIES and measurement.pptx
Ad

More from Thodoris Bais (20)

PPTX
EclipseCon 2021 NoSQL Endgame
PDF
You Graduated Now What ECE UoWM 2021
PPTX
NoSQL Endgame LWJUG 2021
PDF
Be the Leader of Your Own Career Global Summit for Java Devs 21
PDF
How to grow an amazing community - JavaLand 2021
PPTX
Securing eHealth, eGovernment and eBanking with Java - IT-Tage 2020 Conference
PPTX
NoSQL Endgame DevoxxUA Conference 2020
PPTX
Securing eHealth, eGovernment and eBanking with Java - JCON Conference
PDF
Be the Leader of Your Own Career JCON Conference 2020
PPTX
NoSQL Endgame JCON Conference 2020
PPTX
NoSQL Endgame Percona Live Online 2020
PPTX
Utrecht JUG meetup September 2020
PDF
Developer Career: Own it - SouJava April 2020
PPTX
Securing eHealth and eGovernment with Java - AllTheTalksOnline 2020
PDF
How to pitch an innovative idea in a corporate environment
PPTX
Utrecht JUG meetup February 2020
PDF
Developer Career: Own it - Adorsys 2020
PPTX
Utrecht JUG Meetup January 2020
PDF
Developer Career: Own it - Java2Days 2019
PPTX
Securing eHealth and eGovernment with Java - Java2Days 2019
EclipseCon 2021 NoSQL Endgame
You Graduated Now What ECE UoWM 2021
NoSQL Endgame LWJUG 2021
Be the Leader of Your Own Career Global Summit for Java Devs 21
How to grow an amazing community - JavaLand 2021
Securing eHealth, eGovernment and eBanking with Java - IT-Tage 2020 Conference
NoSQL Endgame DevoxxUA Conference 2020
Securing eHealth, eGovernment and eBanking with Java - JCON Conference
Be the Leader of Your Own Career JCON Conference 2020
NoSQL Endgame JCON Conference 2020
NoSQL Endgame Percona Live Online 2020
Utrecht JUG meetup September 2020
Developer Career: Own it - SouJava April 2020
Securing eHealth and eGovernment with Java - AllTheTalksOnline 2020
How to pitch an innovative idea in a corporate environment
Utrecht JUG meetup February 2020
Developer Career: Own it - Adorsys 2020
Utrecht JUG Meetup January 2020
Developer Career: Own it - Java2Days 2019
Securing eHealth and eGovernment with Java - Java2Days 2019

Recently uploaded (20)

PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
L1 - Introduction to python Backend.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
System and Network Administration Chapter 2
PDF
Nekopoi APK 2025 free lastest update
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Introduction to Artificial Intelligence
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Navsoft: AI-Powered Business Solutions & Custom Software Development
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
2025 Textile ERP Trends: SAP, Odoo & Oracle
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Understanding Forklifts - TECH EHS Solution
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Upgrade and Innovation Strategies for SAP ERP Customers
L1 - Introduction to python Backend.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
System and Network Administration Chapter 2
Nekopoi APK 2025 free lastest update
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
How to Migrate SBCGlobal Email to Yahoo Easily
Introduction to Artificial Intelligence
ISO 45001 Occupational Health and Safety Management System
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
VVF-Customer-Presentation2025-Ver1.9.pptx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems

How JSR 385 could have Saved the Mars Climate Orbiter DevoxxUA 2019