SlideShare a Scribd company logo
1 of 57
How JSR 385
Could Have Saved
the Mars Climate Orbiter
Werner Keil & Thodoris Bais
Thodoris Bais
JUG Founder & Leader
Agile Coach
Trainer
@thodorisbais
Mars
Climate
Orbiter
● Launched on 11
December 1998
● 338 kilograms
● $125 million
● To study Martian
climate, atmosphere
and surface changes
4
5
6
7
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 processes, to detect
the error. That's why we lost the spacecraft.”
—Edward Weiler,
NASA associate administrator for space science,
IEEE Spectrum: Why the Mars Probe went off
course
Other Unit
Mishaps
8
● The 12 October 1492 “mishap”
● “Gimli Glider”, 1983
○ Air Canada Flight 143
○ Received less than half the fuel
needed
● Clarence the Tortoise, 2001
● A whole set of medication dose
errors
Problem Statement
9
What Is the Fundamental Problem?
10
Primitive (Java) types
are primitive types
What Is the Fundamental Problem?
11
● Primitive (Java) types are primitive types
○ As in: building blocks to build other types
● Examples fundamentally in conflict with OOP and DDD:
○ static final double C = 1079252849;
○ static final double SPEED_OF_LIGHT = 1079252849;
○ static final double SPEED_OF_LIGHT_IN_KM_PER_H = 1079252849;
● What it should be:
○ static final Quantity<Speed> SPEED_OF_LIGHT
= Quantities.getQuantity(1079252849, Units.KILOMETRE_PER_HOUR);
Rolling Your Own Library
12
● A lot of work
○ Development
○ Maintenance
○ Upgrades and extensions
● Error-prone
● Are you a units of measurement domain expert?
○ Even of the units of measurement system you’re used to?
What is JSR 385?
13
JSR 385: Units of Measurement API 2.0
14
Description:
This JSR is a major evolution of the Unit API 1.0 (JSR 363) specification.
Focused on the SI System redefinition, modularity and support for Java SE
8/9 and above.
JSR 363: Units of Measurement API
This JSR specifies Java packages for modeling and working with
measurement values, quantities and their corresponding units.
JSR 385 Basic Concepts
15
● Dimensions
● Units
● Quantities
JSR 385 Basic Concepts
16
● Dimensions
● Units
● Quantities
● Prefixes
● Converters
● Formats
● System of units
Quantities
17
Definition of a Physical Quantity
18
“A physical quantity is a physical property of a phenomenon, body, or
substance, that can be quantified by measurement.”
Source: Wikipedia
Definition of a Physical Quantity
19
“A physical quantity is a physical property of a phenomenon, body, or
substance, that can be quantified by measurement.”
Source: Wikipedia
“A physical quantity can be expressed as the combination of a magnitude
expressed by a number – usually a real number – and a unit.”
Ibidem
20
c = 299,792,458 m/s
Value Unit
Speed of Light
Definition of a Physical Quantity
21
“A physical quantity is a physical property of a phenomenon, body, or
substance, that can be quantified by measurement.”
Source: Wikipedia
“A physical quantity can be expressed as the combination of a magnitude
expressed by a number – usually a real number – and a unit.”
“The same physical quantity can be represented equivalently in many unit
systems.”
22
c = 299,792,458 m/s
= 1,079,252,849 km/h
Speed of Light
Units
23
Base Units
24
● m
● s
● kg
● A
● K
● mol
● cd
Derived Units
25
● m/s
● m/s2
● rad (= m/m)
● Hz (= s-1)
● N (= kg·m·s-2)
● °C (= K - 273.15)
Multiples
26
● km
● ms
● Mm?
● ks?
Dimensions
27
Dimensions
28
● L: length
● T: time
● M: mass
● I: electric current
● Θ: thermodynamic temperature
● N: amount of substance
● J: luminous intensity
● (1)
Force: L·M·T-2
Doing the Maths
29
Equality and Equivalence
30
Units:
● kΩ ≠ mHz
● kΩ ≠ mΩ
● kΩ ≡ kΩ
● N ≅ kg·m·s-2
● kg·m-2 ≅ mg·mm-2
Quantities:
● 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 Ω
Quantity Addition
● 1 Ω + 1 Ω = 2 Ω
● 1 Ω + 1 mΩ = 1.001 Ω
● 1 mΩ + 1 Ω = 1,001 mΩ
● 1 Ω + 1 m “does not compute”
31
Question: How Much is 0 °C + 0 °C?
32
Question: How Much is 0 °C + 0 °C?
● 0 °C?
33
Question: How Much is 0 °C + 0 °C?
● 0 °C?
● 0 °C?
34
Question: How Much is 0 °C + 0 °C?
● 0 °C?
● 0 °C?
● 273.15 °C?
35
Question: How Much is 0 °C + 0 °C?
● 0 °C
● 0 °C
● 273.15 °C
36
Question: How Much is 0 °C + 0 °C?
● 0 °C
● 0 °C
● 273.15 °C
Two absolute temperatures:
0 °C + 0 °C = 273.15 K + 273.15 K
= 546.30 K
= 273.15 °C 37
Question: 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.15 K + 0 K
= 273.15 K
= 0 °C 38
Question: How Much is 0 °C + 0 °C?
● 0 °C
● 0 °C
● 273.15 °C
Two temperature changes:
0 °C + 0 °C = 0 K + 0 K
= 0 K
= 0 °C 39
Question: 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)
40
Multiplication
41
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
Division
42
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
Powers
43
Units:
● (m)2 = m2
● (km)2 = km2
● (m2)2 = m4
Quantities:
● (3 m)2 = 9 m2
Celsius Revisited
44
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
Parsing Units and
Quantities
45
Speed of Light
46
● 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
Systems of Unit
47
Systems of Unit
48
● Metric system
○ Metre, kilogram, second, ampere, …
● Imperial system
○ Foot, ounce, pound, gallon, Fahrenheit, horsepower, …
● United States customary units
○ Foot, ounce, pound, gallon, Fahrenheit, gallon, …
● Roman units of measurement
○ Pes, uncia, libra, …
● Norwegian units of measurement
○ Fot, favn, mål, tønne, snes, …
Demo Time!
49
What Was the Fundamental Problem Again?
50
Primitive (Java) types
are primitive types
JSR 385 Status
51
JSR 385
52
● JCP page
○ https://www.jcp.org/en/jsr/detail?id=385
● GitHub repositories
○ https://github.com/unitsofmeasurement/
● Current status:
○ Public Review (PR)
○ Preparing for Final Release
A Small Word about JCP
and JSRs…
53
The Java Community Process
54
“The JCP gives you a chance to have your own work become an official
component of the Java platform and to offer suggestions for improving and
growing the technology. Either way, everyone in the Java community benefits
from your participation. That's one of the reasons the JCP is open to everyone.”
Source: https://www.jcp.org/en/participation/overview
Becoming a JCP Member
55
“Membership in the JCP offers you a chance to become a permanent part of
the Java platform's history by contributing your work and recommendations to
the various standard specifications, and/or a chance of serving on the
Executive Committee.”
Source: https://www.jcp.org/en/participation/membership
56
Thank you!
57

More Related Content

What's hot

6161103 1 general principles
6161103 1 general principles6161103 1 general principles
6161103 1 general principles
etcenterrbru
 
Spm physics-formula-list-form4 p
Spm physics-formula-list-form4 pSpm physics-formula-list-form4 p
Spm physics-formula-list-form4 p
BoonKing Gee
 

What's hot (19)

Physical constants
Physical constantsPhysical constants
Physical constants
 
Units and Measurement
Units and MeasurementUnits and Measurement
Units and Measurement
 
6161103 1 general principles
6161103 1 general principles6161103 1 general principles
6161103 1 general principles
 
Standard system for weights
Standard system for weightsStandard system for weights
Standard system for weights
 
AP Physics 1 Equations
AP Physics 1 Equations AP Physics 1 Equations
AP Physics 1 Equations
 
Unit-1 : Units and Dimensions
Unit-1 : Units and DimensionsUnit-1 : Units and Dimensions
Unit-1 : Units and Dimensions
 
Basic science
Basic scienceBasic science
Basic science
 
Uslides2
Uslides2Uslides2
Uslides2
 
Units Dimensions Error 3
Units Dimensions Error 3Units Dimensions Error 3
Units Dimensions Error 3
 
1. gravitation
1. gravitation1. gravitation
1. gravitation
 
Dinamika partikel Mata Kuliah Konsep Dasar IPA
Dinamika partikel Mata Kuliah Konsep Dasar IPADinamika partikel Mata Kuliah Konsep Dasar IPA
Dinamika partikel Mata Kuliah Konsep Dasar IPA
 
Units Dimensions Error 4
Units Dimensions Error 4Units Dimensions Error 4
Units Dimensions Error 4
 
Units & measurements
Units &  measurementsUnits &  measurements
Units & measurements
 
Chapter 4 Powerpoint
Chapter 4 PowerpointChapter 4 Powerpoint
Chapter 4 Powerpoint
 
Lab 8
Lab 8Lab 8
Lab 8
 
Physics formula list
Physics formula listPhysics formula list
Physics formula list
 
Spm physics-formula-list-form4 p
Spm physics-formula-list-form4 pSpm physics-formula-list-form4 p
Spm physics-formula-list-form4 p
 
Lo #1
Lo #1Lo #1
Lo #1
 
Basic Physics Quantities
Basic Physics QuantitiesBasic Physics Quantities
Basic Physics Quantities
 

Similar to How JSR 385 Could have Saved the Mars Climate Orbiter DWX June 2019

3-measurement-161127184347.docx
3-measurement-161127184347.docx3-measurement-161127184347.docx
3-measurement-161127184347.docx
Home
 
measurement units slideshow chapter one pdf
measurement units slideshow chapter one pdfmeasurement units slideshow chapter one pdf
measurement units slideshow chapter one pdf
7gxrufzxu
 
Math of physics
Math of physicsMath of physics
Math of physics
bip1209
 

Similar to How JSR 385 Could have Saved the Mars Climate Orbiter DWX June 2019 (20)

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
 
Chapter 1 - Unit s and Measurement.pptx
Chapter 1 - Unit s and Measurement.pptxChapter 1 - Unit s and Measurement.pptx
Chapter 1 - Unit s and Measurement.pptx
 
3-measurement-161127184347.docx
3-measurement-161127184347.docx3-measurement-161127184347.docx
3-measurement-161127184347.docx
 
ScannerGo_1665225858109.pptx
ScannerGo_1665225858109.pptxScannerGo_1665225858109.pptx
ScannerGo_1665225858109.pptx
 
Measurement class 11
Measurement class 11 Measurement class 11
Measurement class 11
 
Pengukuran
Pengukuran Pengukuran
Pengukuran
 
Chapter 2 unit and measurements
Chapter 2 unit and measurementsChapter 2 unit and measurements
Chapter 2 unit and measurements
 
3-measurement-161127184347.pdf
3-measurement-161127184347.pdf3-measurement-161127184347.pdf
3-measurement-161127184347.pdf
 
Units and Measurement
Units and MeasurementUnits and Measurement
Units and Measurement
 
Lecture Notes: EEEC6430312 Measurements And Instrumentation - Fundamentals O...
Lecture Notes:  EEEC6430312 Measurements And Instrumentation - Fundamentals O...Lecture Notes:  EEEC6430312 Measurements And Instrumentation - Fundamentals O...
Lecture Notes: EEEC6430312 Measurements And Instrumentation - Fundamentals O...
 
Diploma sem 2 applied science physics-unit 1-chap 1 measurements
Diploma sem 2 applied science physics-unit 1-chap 1 measurementsDiploma sem 2 applied science physics-unit 1-chap 1 measurements
Diploma sem 2 applied science physics-unit 1-chap 1 measurements
 
measurement units slideshow chapter one pdf
measurement units slideshow chapter one pdfmeasurement units slideshow chapter one pdf
measurement units slideshow chapter one pdf
 
System of Units
System of UnitsSystem of Units
System of Units
 
1. Units and Measurements.pptx
1. Units and Measurements.pptx1. Units and Measurements.pptx
1. Units and Measurements.pptx
 
Units , Measurement and Dimensional Analysis
Units , Measurement and Dimensional AnalysisUnits , Measurement and Dimensional Analysis
Units , Measurement and Dimensional Analysis
 
Ch1z5echemfnd 110115225130-phpapp02
Ch1z5echemfnd 110115225130-phpapp02Ch1z5echemfnd 110115225130-phpapp02
Ch1z5echemfnd 110115225130-phpapp02
 
Scientific measurement (adapted)
Scientific measurement (adapted)Scientific measurement (adapted)
Scientific measurement (adapted)
 
5.1-Fundamental Dimensions and Base Units-converted.pptx
5.1-Fundamental Dimensions and Base Units-converted.pptx5.1-Fundamental Dimensions and Base Units-converted.pptx
5.1-Fundamental Dimensions and Base Units-converted.pptx
 
Presentation1.pdf
Presentation1.pdfPresentation1.pdf
Presentation1.pdf
 
Math of physics
Math of physicsMath of physics
Math of physics
 

More from Thodoris Bais

More from Thodoris Bais (20)

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

Recently uploaded

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 

Recently uploaded (20)

TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 

How JSR 385 Could have Saved the Mars Climate Orbiter DWX June 2019

  • 1. How JSR 385 Could Have Saved the Mars Climate Orbiter Werner Keil & Thodoris Bais
  • 2.
  • 3. Thodoris Bais JUG Founder & Leader Agile Coach Trainer @thodorisbais
  • 4. Mars Climate Orbiter ● Launched on 11 December 1998 ● 338 kilograms ● $125 million ● To study Martian climate, atmosphere and surface changes 4
  • 5. 5
  • 6. 6
  • 7. 7 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 processes, to detect the error. That's why we lost the spacecraft.” —Edward Weiler, NASA associate administrator for space science, IEEE Spectrum: Why the Mars Probe went off course
  • 8. Other Unit Mishaps 8 ● The 12 October 1492 “mishap” ● “Gimli Glider”, 1983 ○ Air Canada Flight 143 ○ Received less than half the fuel needed ● Clarence the Tortoise, 2001 ● A whole set of medication dose errors
  • 10. What Is the Fundamental Problem? 10 Primitive (Java) types are primitive types
  • 11. What Is the Fundamental Problem? 11 ● Primitive (Java) types are primitive types ○ As in: building blocks to build other types ● Examples fundamentally in conflict with OOP and DDD: ○ static final double C = 1079252849; ○ static final double SPEED_OF_LIGHT = 1079252849; ○ static final double SPEED_OF_LIGHT_IN_KM_PER_H = 1079252849; ● What it should be: ○ static final Quantity<Speed> SPEED_OF_LIGHT = Quantities.getQuantity(1079252849, Units.KILOMETRE_PER_HOUR);
  • 12. Rolling Your Own Library 12 ● A lot of work ○ Development ○ Maintenance ○ Upgrades and extensions ● Error-prone ● Are you a units of measurement domain expert? ○ Even of the units of measurement system you’re used to?
  • 13. What is JSR 385? 13
  • 14. JSR 385: Units of Measurement API 2.0 14 Description: This JSR is a major evolution of the Unit API 1.0 (JSR 363) specification. Focused on the SI System redefinition, modularity and support for Java SE 8/9 and above. JSR 363: Units of Measurement API This JSR specifies Java packages for modeling and working with measurement values, quantities and their corresponding units.
  • 15. JSR 385 Basic Concepts 15 ● Dimensions ● Units ● Quantities
  • 16. JSR 385 Basic Concepts 16 ● Dimensions ● Units ● Quantities ● Prefixes ● Converters ● Formats ● System of units
  • 18. Definition of a Physical Quantity 18 “A physical quantity is a physical property of a phenomenon, body, or substance, that can be quantified by measurement.” Source: Wikipedia
  • 19. Definition of a Physical Quantity 19 “A physical quantity is a physical property of a phenomenon, body, or substance, that can be quantified by measurement.” Source: Wikipedia “A physical quantity can be expressed as the combination of a magnitude expressed by a number – usually a real number – and a unit.” Ibidem
  • 20. 20 c = 299,792,458 m/s Value Unit Speed of Light
  • 21. Definition of a Physical Quantity 21 “A physical quantity is a physical property of a phenomenon, body, or substance, that can be quantified by measurement.” Source: Wikipedia “A physical quantity can be expressed as the combination of a magnitude expressed by a number – usually a real number – and a unit.” “The same physical quantity can be represented equivalently in many unit systems.”
  • 22. 22 c = 299,792,458 m/s = 1,079,252,849 km/h Speed of Light
  • 24. Base Units 24 ● m ● s ● kg ● A ● K ● mol ● cd
  • 25. Derived Units 25 ● m/s ● m/s2 ● rad (= m/m) ● Hz (= s-1) ● N (= kg·m·s-2) ● °C (= K - 273.15)
  • 28. Dimensions 28 ● L: length ● T: time ● M: mass ● I: electric current ● Θ: thermodynamic temperature ● N: amount of substance ● J: luminous intensity ● (1) Force: L·M·T-2
  • 30. Equality and Equivalence 30 Units: ● kΩ ≠ mHz ● kΩ ≠ mΩ ● kΩ ≡ kΩ ● N ≅ kg·m·s-2 ● kg·m-2 ≅ mg·mm-2 Quantities: ● 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 Ω
  • 31. Quantity Addition ● 1 Ω + 1 Ω = 2 Ω ● 1 Ω + 1 mΩ = 1.001 Ω ● 1 mΩ + 1 Ω = 1,001 mΩ ● 1 Ω + 1 m “does not compute” 31
  • 32. Question: How Much is 0 °C + 0 °C? 32
  • 33. Question: How Much is 0 °C + 0 °C? ● 0 °C? 33
  • 34. Question: How Much is 0 °C + 0 °C? ● 0 °C? ● 0 °C? 34
  • 35. Question: How Much is 0 °C + 0 °C? ● 0 °C? ● 0 °C? ● 273.15 °C? 35
  • 36. Question: How Much is 0 °C + 0 °C? ● 0 °C ● 0 °C ● 273.15 °C 36
  • 37. Question: How Much is 0 °C + 0 °C? ● 0 °C ● 0 °C ● 273.15 °C Two absolute temperatures: 0 °C + 0 °C = 273.15 K + 273.15 K = 546.30 K = 273.15 °C 37
  • 38. Question: 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.15 K + 0 K = 273.15 K = 0 °C 38
  • 39. Question: How Much is 0 °C + 0 °C? ● 0 °C ● 0 °C ● 273.15 °C Two temperature changes: 0 °C + 0 °C = 0 K + 0 K = 0 K = 0 °C 39
  • 40. Question: 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) 40
  • 41. Multiplication 41 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
  • 42. Division 42 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
  • 43. Powers 43 Units: ● (m)2 = m2 ● (km)2 = km2 ● (m2)2 = m4 Quantities: ● (3 m)2 = 9 m2
  • 44. Celsius Revisited 44 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
  • 46. Speed of Light 46 ● 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
  • 48. Systems of Unit 48 ● Metric system ○ Metre, kilogram, second, ampere, … ● Imperial system ○ Foot, ounce, pound, gallon, Fahrenheit, horsepower, … ● United States customary units ○ Foot, ounce, pound, gallon, Fahrenheit, gallon, … ● Roman units of measurement ○ Pes, uncia, libra, … ● Norwegian units of measurement ○ Fot, favn, mål, tønne, snes, …
  • 50. What Was the Fundamental Problem Again? 50 Primitive (Java) types are primitive types
  • 52. JSR 385 52 ● JCP page ○ https://www.jcp.org/en/jsr/detail?id=385 ● GitHub repositories ○ https://github.com/unitsofmeasurement/ ● Current status: ○ Public Review (PR) ○ Preparing for Final Release
  • 53. A Small Word about JCP and JSRs… 53
  • 54. The Java Community Process 54 “The JCP gives you a chance to have your own work become an official component of the Java platform and to offer suggestions for improving and growing the technology. Either way, everyone in the Java community benefits from your participation. That's one of the reasons the JCP is open to everyone.” Source: https://www.jcp.org/en/participation/overview
  • 55. Becoming a JCP Member 55 “Membership in the JCP offers you a chance to become a permanent part of the Java platform's history by contributing your work and recommendations to the various standard specifications, and/or a chance of serving on the Executive Committee.” Source: https://www.jcp.org/en/participation/membership
  • 56. 56

Editor's Notes

  1. Thousand separator Decimal point Star Times Middle dot -1 sub html or unicode minus and 1 Carrot Hours Local represantation of hours