SlideShare ist ein Scribd-Unternehmen logo
1 von 44
How JSR 385
Could Have Saved
the Mars Climate Orbiter
Thodoris Bais, Werner Keil, Filip Van Laenen
Who am I?
● Consultant – Coach
● Creative Cosmopolitan
● Open Source Evangelist
● Software Architect
● Spec Lead – JSR385
● Eclipse UOMo Project Lead
Twitter @wernerkeil
Mars
Climate
Orbiter
● Launched on 11
December 1998
● 338 kilograms
● $125 million
● To study Martian
climate, atmosphere
and surface changes
3
5
6
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
7
● 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
8
What Is the Fundamental Problem?
9
Primitive (Java) types
are primitive types
What Is the Fundamental Problem?
10
● 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
11
● 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?
12
JSR 385: Units of Measurement API 2.0
13
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
● Prefixes
● Converters
● Formats
● System of units
Quantities
16
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
“A physical quantity can be expressed as the combination of a magnitude
expressed by a number – usually a real number – and a unit.”
Ibidem
19
c = 299,792,458 m/s
Value Unit
Speed of Light
21
c = 299,792,458 m/s
= 1,079,252,849 km/h
Speed of Light
Units
22
Base Units
23
● m
● s
● kg
● A
● K
● mol
● cd
Derived Units
24
● m/s
● m/s2
● rad (= m/m)
● Hz (= s-1)
● N (= kg·m·s-2)
● °C (= K - 273.15)
Multiples
25
● km
● ms
● Mm?
● ks?
Dimensions
26
Dimensions
27
● 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 Math
28
Equality and Equivalence
29
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 Ω
Question: How Much is 0 °C + 0 °C?
31
Question: How Much is 0 °C + 0 °C?
● 0 °C?
32
Question: How Much is 0 °C + 0 °C?
● 0 °C?
● 0 °C?
33
Question: How Much is 0 °C + 0 °C?
● 0 °C?
● 0 °C?
● 273.15 °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
Two absolute temperatures:
0 °C + 0 °C = 273.15 K + 273.15 K
= 546.30 K
= 273.15 °C 36
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 37
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 38
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)
39
Parsing Units and
Quantities
44
Systems of Unit
46
Systems of Unit
47
● Metric system
○ Metre, kilogram, second, ampere, …
● Imperial system
○ Foot, ounce, pound, gallon, Fahrenheit, horsepower, …
● United States customary units
○ Foot, ounce, pound, gallon, Fahrenheit, horsepower, …
● Roman units of measurement
○ Pes, uncia, libra, …
● Norwegian units of measurement
○ Fot, favn, mål, tønne, snes, …
JSR 385 Status
49
JSR 385
50
● 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…
51
The Java Community Process
52
“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
53
“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
54
Questions?
Comments?
55

Weitere ähnliche Inhalte

Was ist angesagt?

SN Ia Rate in Intermediate-Redshift Galaxy Clusters - Eli Kasai
SN Ia Rate in Intermediate-Redshift Galaxy Clusters - Eli KasaiSN Ia Rate in Intermediate-Redshift Galaxy Clusters - Eli Kasai
SN Ia Rate in Intermediate-Redshift Galaxy Clusters - Eli Kasai
CosmoAIMS Bassett
 
Jim Metz.SAR Contour Landscapes
Jim Metz.SAR Contour LandscapesJim Metz.SAR Contour Landscapes
Jim Metz.SAR Contour Landscapes
James T. Metz
 
Physicprojectof211
Physicprojectof211Physicprojectof211
Physicprojectof211
anran chen
 

Was ist angesagt? (9)

Privilege Project Vikram Andem
Privilege Project Vikram AndemPrivilege Project Vikram Andem
Privilege Project Vikram Andem
 
How to plan and execute contractile measurements in permeabilized muscle fibe...
How to plan and execute contractile measurements in permeabilized muscle fibe...How to plan and execute contractile measurements in permeabilized muscle fibe...
How to plan and execute contractile measurements in permeabilized muscle fibe...
 
Frontiers of Science and Clouds - Tim Bell - Openstack Day Israel 2016
Frontiers of Science and Clouds - Tim Bell - Openstack Day Israel 2016Frontiers of Science and Clouds - Tim Bell - Openstack Day Israel 2016
Frontiers of Science and Clouds - Tim Bell - Openstack Day Israel 2016
 
SN Ia Rate in Intermediate-Redshift Galaxy Clusters - Eli Kasai
SN Ia Rate in Intermediate-Redshift Galaxy Clusters - Eli KasaiSN Ia Rate in Intermediate-Redshift Galaxy Clusters - Eli Kasai
SN Ia Rate in Intermediate-Redshift Galaxy Clusters - Eli Kasai
 
Science Technology Engineering Mathematics
Science Technology Engineering MathematicsScience Technology Engineering Mathematics
Science Technology Engineering Mathematics
 
Global Cyberinfrastructure to Support e-Research
Global Cyberinfrastructure to Support e-ResearchGlobal Cyberinfrastructure to Support e-Research
Global Cyberinfrastructure to Support e-Research
 
Jim Metz.SAR Contour Landscapes
Jim Metz.SAR Contour LandscapesJim Metz.SAR Contour Landscapes
Jim Metz.SAR Contour Landscapes
 
Physicprojectof211
Physicprojectof211Physicprojectof211
Physicprojectof211
 
200911 mbt-ai4_a_dintm__presentation
200911  mbt-ai4_a_dintm__presentation200911  mbt-ai4_a_dintm__presentation
200911 mbt-ai4_a_dintm__presentation
 

Ähnlich wie How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day

Chapter i quantities editing
Chapter i quantities editingChapter i quantities editing
Chapter i quantities editing
rozi arrozi
 
PHM2106-Presentation-Hubbard
PHM2106-Presentation-HubbardPHM2106-Presentation-Hubbard
PHM2106-Presentation-Hubbard
Charles Hubbard
 
Interpolating California's Temperature
Interpolating California's TemperatureInterpolating California's Temperature
Interpolating California's Temperature
Doug Callaway
 
Chapter i quantities
Chapter i quantitiesChapter i quantities
Chapter i quantities
rozi arrozi
 

Ähnlich wie How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day (20)

How JSR 385 Could have Saved the Mars Climate Orbiter DWX June 2019
How JSR 385 Could have Saved the Mars Climate Orbiter DWX June 2019How JSR 385 Could have Saved the Mars Climate Orbiter DWX June 2019
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 OrbiterHow JSR-385 Could Have Saved the Mars Climate Orbiter
How JSR-385 Could Have Saved the Mars Climate Orbiter
 
How JSR 385 could have saved the Mars Climate Orbiter
How JSR 385 could have saved the Mars Climate OrbiterHow JSR 385 could have saved the Mars Climate Orbiter
How JSR 385 could have saved the Mars Climate Orbiter
 
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...
 
Scientific measurement (adapted)
Scientific measurement (adapted)Scientific measurement (adapted)
Scientific measurement (adapted)
 
Clustering Methods with R
Clustering Methods with RClustering Methods with R
Clustering Methods with R
 
Four Hats of Math: CFD
Four Hats of Math: CFDFour Hats of Math: CFD
Four Hats of Math: CFD
 
Chapter i quantities editing
Chapter i quantities editingChapter i quantities editing
Chapter i quantities editing
 
The PubChemQC Project
The PubChemQC ProjectThe PubChemQC Project
The PubChemQC Project
 
Clustering Methods with R
Clustering Methods with RClustering Methods with R
Clustering Methods with R
 
A More Scaleable Way of Making Recommendations with MLlib-(Xiangrui Meng, Dat...
A More Scaleable Way of Making Recommendations with MLlib-(Xiangrui Meng, Dat...A More Scaleable Way of Making Recommendations with MLlib-(Xiangrui Meng, Dat...
A More Scaleable Way of Making Recommendations with MLlib-(Xiangrui Meng, Dat...
 
The Dark Side of the Universe
The Dark Side of the UniverseThe Dark Side of the Universe
The Dark Side of the Universe
 
Energy saving policies final
Energy saving policies finalEnergy saving policies final
Energy saving policies final
 
TEAMCD_SDR_Briefing
TEAMCD_SDR_BriefingTEAMCD_SDR_Briefing
TEAMCD_SDR_Briefing
 
PHM2106-Presentation-Hubbard
PHM2106-Presentation-HubbardPHM2106-Presentation-Hubbard
PHM2106-Presentation-Hubbard
 
TU FINAL THE MEASURING DEVICE
TU FINAL THE MEASURING DEVICETU FINAL THE MEASURING DEVICE
TU FINAL THE MEASURING DEVICE
 
Chapter 2 unit and measurements
Chapter 2 unit and measurementsChapter 2 unit and measurements
Chapter 2 unit and measurements
 
TU FINAL THE MEASURING DEVICE 1
TU FINAL THE MEASURING DEVICE 1TU FINAL THE MEASURING DEVICE 1
TU FINAL THE MEASURING DEVICE 1
 
Interpolating California's Temperature
Interpolating California's TemperatureInterpolating California's Temperature
Interpolating California's Temperature
 
Chapter i quantities
Chapter i quantitiesChapter i quantities
Chapter i quantities
 

Mehr von Werner Keil

Mehr von Werner Keil (20)

Securing eHealth, eGovernment and eBanking with Java - DWX '21
Securing eHealth, eGovernment and eBanking with Java - DWX '21Securing eHealth, eGovernment and eBanking with Java - DWX '21
Securing eHealth, eGovernment and eBanking with Java - DWX '21
 
OpenDDR and Jakarta MVC - JavaLand 2021
OpenDDR and Jakarta MVC - JavaLand 2021OpenDDR and Jakarta MVC - JavaLand 2021
OpenDDR and Jakarta MVC - JavaLand 2021
 
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
 
OpenDDR and Jakarta MVC - Java2Days 2020 Virtual
OpenDDR and Jakarta MVC - Java2Days 2020 VirtualOpenDDR and Jakarta MVC - Java2Days 2020 Virtual
OpenDDR and Jakarta MVC - Java2Days 2020 Virtual
 
NoSQL Endgame - Java2Days 2020 Virtual
NoSQL Endgame - Java2Days 2020 VirtualNoSQL Endgame - Java2Days 2020 Virtual
NoSQL Endgame - Java2Days 2020 Virtual
 
JCON 2020: Mobile Java Web Applications with MVC and OpenDDR
JCON 2020: Mobile Java Web Applications with MVC and OpenDDRJCON 2020: Mobile Java Web Applications with MVC and OpenDDR
JCON 2020: Mobile Java Web Applications with MVC and OpenDDR
 
Money, Money, Money, can be funny with JSR 354 (Devoxx BE)
Money, Money, Money, can be funny with JSR 354 (Devoxx BE)Money, Money, Money, can be funny with JSR 354 (Devoxx BE)
Money, Money, Money, can be funny with JSR 354 (Devoxx BE)
 
Money, Money, Money, can be funny with JSR 354 (DWX 2019)
Money, Money, Money, can be funny with JSR 354 (DWX 2019)Money, Money, Money, can be funny with JSR 354 (DWX 2019)
Money, Money, Money, can be funny with JSR 354 (DWX 2019)
 
NoSQL: The first New Jakarta EE Specification (DWX 2019)
NoSQL: The first New Jakarta EE Specification (DWX 2019)NoSQL: The first New Jakarta EE Specification (DWX 2019)
NoSQL: The first New Jakarta EE Specification (DWX 2019)
 
JNoSQL: The Definitive Solution for Java and NoSQL Databases
JNoSQL: The Definitive Solution for Java and NoSQL DatabasesJNoSQL: The Definitive Solution for Java and NoSQL Databases
JNoSQL: The Definitive Solution for Java and NoSQL Databases
 
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL DatabasesEclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
 
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
 
Performance Monitoring for the Cloud - Java2Days 2017
Performance Monitoring for the Cloud - Java2Days 2017Performance Monitoring for the Cloud - Java2Days 2017
Performance Monitoring for the Cloud - Java2Days 2017
 
Java2Days - Security for JavaEE and the Cloud
Java2Days - Security for JavaEE and the CloudJava2Days - Security for JavaEE and the Cloud
Java2Days - Security for JavaEE and the Cloud
 
Apache DeviceMap - Web-Dev-BBQ Stuttgart
Apache DeviceMap - Web-Dev-BBQ StuttgartApache DeviceMap - Web-Dev-BBQ Stuttgart
Apache DeviceMap - Web-Dev-BBQ Stuttgart
 
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
 
JavaLand: Quantified Social - Fitness-Geräte und -Portale mit Agorava
JavaLand: Quantified Social - Fitness-Geräte und -Portale mit AgoravaJavaLand: Quantified Social - Fitness-Geräte und -Portale mit Agorava
JavaLand: Quantified Social - Fitness-Geräte und -Portale mit Agorava
 
Enterprise 2.0 with Open Source Frameworks like Agorava
Enterprise 2.0 with Open Source Frameworks like AgoravaEnterprise 2.0 with Open Source Frameworks like Agorava
Enterprise 2.0 with Open Source Frameworks like Agorava
 
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
 
Apache DeviceMap - ApacheCon core Europe 2015
Apache DeviceMap - ApacheCon core Europe 2015Apache DeviceMap - ApacheCon core Europe 2015
Apache DeviceMap - ApacheCon core Europe 2015
 

Kürzlich hochgeladen

Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
mbmh111980
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
Max Lee
 

Kürzlich hochgeladen (20)

Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdf
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and Prevention
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
Malaysia E-Invoice digital signature docpptx
Malaysia E-Invoice digital signature docpptxMalaysia E-Invoice digital signature docpptx
Malaysia E-Invoice digital signature docpptx
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdf
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion Production
 

How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day

  • 1. How JSR 385 Could Have Saved the Mars Climate Orbiter Thodoris Bais, Werner Keil, Filip Van Laenen
  • 2. Who am I? ● Consultant – Coach ● Creative Cosmopolitan ● Open Source Evangelist ● Software Architect ● Spec Lead – JSR385 ● Eclipse UOMo Project Lead Twitter @wernerkeil
  • 3. Mars Climate Orbiter ● Launched on 11 December 1998 ● 338 kilograms ● $125 million ● To study Martian climate, atmosphere and surface changes 3
  • 4. 5
  • 5. 6 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
  • 6. Other Unit Mishaps 7 ● 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
  • 8. What Is the Fundamental Problem? 9 Primitive (Java) types are primitive types
  • 9. What Is the Fundamental Problem? 10 ● 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);
  • 10. Rolling Your Own Library 11 ● 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?
  • 11. What is JSR 385? 12
  • 12. JSR 385: Units of Measurement API 2.0 13 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.
  • 13. JSR 385 Basic Concepts 15 ● Dimensions ● Units ● Quantities ● Prefixes ● Converters ● Formats ● System of units
  • 15. 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 “A physical quantity can be expressed as the combination of a magnitude expressed by a number – usually a real number – and a unit.” Ibidem
  • 16. 19 c = 299,792,458 m/s Value Unit Speed of Light
  • 17. 21 c = 299,792,458 m/s = 1,079,252,849 km/h Speed of Light
  • 19. Base Units 23 ● m ● s ● kg ● A ● K ● mol ● cd
  • 20. Derived Units 24 ● m/s ● m/s2 ● rad (= m/m) ● Hz (= s-1) ● N (= kg·m·s-2) ● °C (= K - 273.15)
  • 23. Dimensions 27 ● L: length ● T: time ● M: mass ● I: electric current ● Θ: thermodynamic temperature ● N: amount of substance ● J: luminous intensity ● (1) Force: L·M·T-2
  • 25. Equality and Equivalence 29 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 Ω
  • 26. Question: How Much is 0 °C + 0 °C? 31
  • 27. Question: How Much is 0 °C + 0 °C? ● 0 °C? 32
  • 28. Question: How Much is 0 °C + 0 °C? ● 0 °C? ● 0 °C? 33
  • 29. Question: How Much is 0 °C + 0 °C? ● 0 °C? ● 0 °C? ● 273.15 °C? 34
  • 30. Question: How Much is 0 °C + 0 °C? ● 0 °C ● 0 °C ● 273.15 °C 35
  • 31. 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 36
  • 32. 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 37
  • 33. 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 38
  • 34. 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) 39
  • 37. Systems of Unit 47 ● Metric system ○ Metre, kilogram, second, ampere, … ● Imperial system ○ Foot, ounce, pound, gallon, Fahrenheit, horsepower, … ● United States customary units ○ Foot, ounce, pound, gallon, Fahrenheit, horsepower, … ● Roman units of measurement ○ Pes, uncia, libra, … ● Norwegian units of measurement ○ Fot, favn, mål, tønne, snes, …
  • 39. JSR 385 50 ● 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
  • 40. A Small Word about JCP and JSRs… 51
  • 41. The Java Community Process 52 “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
  • 42. Becoming a JCP Member 53 “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
  • 43. 54