SlideShare a Scribd company logo
1 of 37
Trinity College, Dublin 08 – 11 June 2010 UCUM Unified Code for Units of Measure Werner Keil Agile Coach, emergn
Our Goal Avoiding Interface and Arithmetic Errors
Emphasis Most of today’s technologies including the current Java Language Releases lack support for common non-trivial Arithmetic problems like Unit Conversions.
Summary Present Situation Historic IT Errors and Bugs Cause of Conversion Errors  Proposed Changes Unit and Measure Support Type Safety Case Studies Demo Q&A
What do these disasters have in common? Patriot MissileThe cause was an inaccurate calculation of the time since boot due to a computer arithmetic error. Ariane 5 ExplosionThe floating point number which a value was converted from had a value greater than what would be represented by a 16 bit signed integer.
What do these disasters have in common? Mars Orbiter Preliminary findings indicate that one team used English units (e.g. inches, feet and pounds) while the other used metric units for a key spacecraft operation. NASA lost a $125 million Mars orbiter because a Lockheed Martin engineering team used English units of measurement while the agency's team used the more conventional metric system for a key spacecraft operation This also underlines the added risk when 3rd party contractors are involved or projects are developed Offshore
NASA “Star Wars” Experiment, 1983 23rd March 1983. Ronald Reagan announces SDI (or “Star Wars”): ground-based and space-based systems to protect the US from attack by strategic nuclear ballistic missiles.
1985 Mirror on underside of shuttle SDI Experiment: The Plan Big mountain in Hawaii
1985 SDI Experiment: What really happened
1985: What happened?
NASA Mars Climate Orbiter, 1999
Unit Tests did not find these Errors All previous example illustrate three categories of errors difficult to find through Unit Testing: Interface Errors (e.g. millisecond/second, radian/degree, meters/feet). Arithmetic Errors (e.g. overflow). Conversion Errors.
Causes of Conversion Errors Ambiguity on the unit Gallon Dry / Gallon Liquid Gallon US / Gallon UK Day Sidereal / Day Calendar ... Wrong conversion factors: static final double PIXEL_TO_INCH = 1 / 72; double pixels = inches * PIXEL_TO_INCH
Present Situation Java does not have strongly typed primitive types (like e.g. Ada language). For performance reasons most developer prefer primitive types over objects in their interface. Primitives type arguments often lead to name clashes (methods with the same signature)‏
UCUM Unified  Code for Units of Measure The Unified Code for Units of Measure is a code system intended to include all units of measures being contemporarily used in international science, engineering, and business. The purpose is to facilitate unambiguous electronic communication of quantities together with their units. The focus is on electronic communication, as opposed to communication between humans. A typical application of The Unified Code for Units of Measure are electronic data interchange (EDI) protocols, but there is nothing that prevents it from being used in other types of machine communication. How does it relate?
UCUM Unified  Code for Units of Measure The Unified Code for Units of Measure is inspired by and heavily based on ISO 2955-1983 ANSI X3.50-1986 HL7's extensions called ISO+
JSR-275 Base Classes and Packages Namespace: javax.measure.* Only one interface and one abstract class Measurable<Q extends Quantity> (interface)‏ Measure<V, Q extends Quantity> (abstract class)‏ Three sub-packages Unit (holds the SI and NonSI units)‏ Quantity (holds dimensions mass, length)‏ Converter (holds unit converters)‏
Units and Systems of Unit
Unit Operations Results with Same Dimension	Different Dimension Binary Operations	Binary Operations plus (double) or (long)	root(int) times(double) or (long)	power(int) divide(double) or (long)	times(Unit) compound(Unit)	divide(Unit) Unary Operations 	inverse() © 2007-2009  Creative Arts & Technologies
The King is Dead… Units of Measure API Namespace: org.unitsofmeasure.* Only interfaces and one abstract class Measurable<Q extends Quantity> (interface)‏ Measure<V, Q extends Quantity> (abstract class)‏ Two sub-packages Quantity (holds dimensions mass, length) Util (misc items and helpers)
JSR-256 Mobile Sensor API Namespace: javax.microediton.sensor* Focusing on Sensors, but it got a minimalistic Unit API “in the closet” Unit	Essentially an SI singleton holding relevant unit constants, too. ChannelInfoHolding name, accuracy, data type,measurement ranges, scale and unit MeasurementRangeRange of possible values from minimum to maximum
JSR-256 Sensor States
JSR-256 Sensor Groups Context types categorize sensors into three groups:  ambient, sensors measuring some ambient property of the environment  device, sensors measuring properties related to the device  user, sensors measuring some function of the user  By using context types, it is possible to find, for example, user-related sensors for fitness, or ambient sensors for smart home controlling. Although the granularity of this level does not qualify the sensors very precisely, still in some cases it provides the way to make the distinction, for example, cf. air thermometer (ambient) / clinical thermometer (user).
JSR-256 Quantity The quantity provides a more precise qualifier. The unit and the quantity has a close relation. Some quantities are listed in tables of Unit class. When the quantity and context type is known, it is often easy to guess the full purpose of the sensor. Some examples are given here:  Quantity: electric_current + context type: ambient = sensor measuring electric current, amperemeter Quantity: catalytic_activity + contex type: ambient = sensor measuring catalytic activity
OSGi Measurement Package Namespace: org.osgi.util.measurement SI only Unit API “in the closet” Unit	Essentially an SI singleton holding relevant unit constants, too. MeasurementRepresents a value with an error, a unit and a time-stamp.  StateGroups a state name, value and timestamp.
Eclipse project UOMo One Unit Framework to Measure them All Namespace: org.eclipse.uomo.* Two main areas Static Type Safe Units of Measure Support Based on Units of Measure API On top of ICU4J, the Globalization standard at Eclipse and others (Android, GWT, Google Financial, etc.) UCUM Reference Implementation Successor to Eclipse OHF UCUM Bundle
Case Study: Monetary System Monetary systems are not subject to the JSR, but this illustrates, how easily the framework can be extended to non physical or scientific quantities. Such extension can be valuable by leveraging the framework’s capabilities (formatting, conversion,…)  and applying its usefulness beyond what e.g. java.util.Currency now has to offer.
Currency Conversion Classes
Online Currency Conversion Example
Trading Application Example What happens, if we use built in java.util.Currency and Standard  JSP formats
Money Demo (1) We’ll extend MoneyDemo to show fuel costs in Indian Rupees. First by adding a new currency to MonetarySystem. // Use currency not defined as constant (Indian Rupee). public static final DerivedUnit<Money> INR= monetary(new Currency(„INR") ); Then add this line to MoneyDemo.(also change static import to MonetarySystem.*; ) UnitFormat.getInstance().label(INR, „Rp");
Money Demo (2) Next set the Exchange Rate for Rp. ((Currency) INR).setExchangeRate(0.022);   // 1.0Rp = ~0.022 $ Note, the explicit cast is required here, because getUnits() in SystemOfUnits currently requires a neutral <?> generic collection type.
Money Demo (3) Then we add the following line to the “Display cost.” section of MoneyDemo System.out.println("Trip cost = " + tripCost + " (" + tripCost.to(INR) + ")"); Resulting in the additional output: Trip cost = 87.50 $ (3977.26 Rp)
Links JCP – Java Community Process http://www.jcp.org UCUM http://www.unitsofmeasure.org Units of Measure API http://www.javaforge.com/project/uom
Questions werner@emergn.com Or  info@catmedia.us Twitter: @wernerkeil
Werner Weil: UCUM - epicenter 2010

More Related Content

Viewers also liked

Tbc, Hepatitis B, Neumococo
Tbc, Hepatitis B, NeumococoTbc, Hepatitis B, Neumococo
Tbc, Hepatitis B, NeumococoHelver Gonzales
 
Turning Continuous Improvement and a PMO into an Innovation Team
Turning Continuous Improvement and a PMO into an Innovation Team Turning Continuous Improvement and a PMO into an Innovation Team
Turning Continuous Improvement and a PMO into an Innovation Team KaiNexus
 
The lean hospital what is mean
The lean hospital what is meanThe lean hospital what is mean
The lean hospital what is meanEmad Kotb
 
Practicing Lean 2016 Mark Graban Lean Frontiers
Practicing Lean 2016 Mark Graban Lean FrontiersPracticing Lean 2016 Mark Graban Lean Frontiers
Practicing Lean 2016 Mark Graban Lean FrontiersMark Graban
 
Pure culture technic
Pure culture technicPure culture technic
Pure culture technicRitesh ranjan
 
Culture characteristic of bacteria
Culture characteristic of bacteriaCulture characteristic of bacteria
Culture characteristic of bacteriaDr. Samira Fattah
 

Viewers also liked (8)

Tbc, Hepatitis B, Neumococo
Tbc, Hepatitis B, NeumococoTbc, Hepatitis B, Neumococo
Tbc, Hepatitis B, Neumococo
 
Task analysis
Task analysisTask analysis
Task analysis
 
Turning Continuous Improvement and a PMO into an Innovation Team
Turning Continuous Improvement and a PMO into an Innovation Team Turning Continuous Improvement and a PMO into an Innovation Team
Turning Continuous Improvement and a PMO into an Innovation Team
 
The lean hospital what is mean
The lean hospital what is meanThe lean hospital what is mean
The lean hospital what is mean
 
Anh Nhuyen, Rovio
Anh Nhuyen, RovioAnh Nhuyen, Rovio
Anh Nhuyen, Rovio
 
Practicing Lean 2016 Mark Graban Lean Frontiers
Practicing Lean 2016 Mark Graban Lean FrontiersPracticing Lean 2016 Mark Graban Lean Frontiers
Practicing Lean 2016 Mark Graban Lean Frontiers
 
Pure culture technic
Pure culture technicPure culture technic
Pure culture technic
 
Culture characteristic of bacteria
Culture characteristic of bacteriaCulture characteristic of bacteria
Culture characteristic of bacteria
 

Similar to Werner Weil: UCUM - epicenter 2010

Mr. Keil Werner - UOMO 2011
Mr. Keil Werner - UOMO 2011Mr. Keil Werner - UOMO 2011
Mr. Keil Werner - UOMO 2011beloslab
 
M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)
M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)
M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)Werner Keil
 
M4M 2 the Rescue of M2M - Eclipse DemoCamps Kepler 2013
M4M 2 the Rescue of M2M - Eclipse DemoCamps Kepler 2013M4M 2 the Rescue of M2M - Eclipse DemoCamps Kepler 2013
M4M 2 the Rescue of M2M - Eclipse DemoCamps Kepler 2013Werner Keil
 
M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013
M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013
M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013Werner Keil
 
geecon 2013 - Standards for the Future of Java Embedded
geecon 2013 - Standards for the Future of Java Embeddedgeecon 2013 - Standards for the Future of Java Embedded
geecon 2013 - Standards for the Future of Java EmbeddedWerner Keil
 
Software Requirements and Design Process in the Aerospace Industry
Software Requirements and Design Process in the Aerospace IndustrySoftware Requirements and Design Process in the Aerospace Industry
Software Requirements and Design Process in the Aerospace IndustryLeif Bloomquist
 
Applying Drools in Assistive Technology
Applying Drools in Assistive TechnologyApplying Drools in Assistive Technology
Applying Drools in Assistive Technologytsurdilovic
 
Automatic Test Generation for Space
Automatic Test Generation for SpaceAutomatic Test Generation for Space
Automatic Test Generation for SpaceUlisses Costa
 
The Eclipse M2M IWG and Standards for the Internet of Things
The Eclipse M2M IWG and Standards for the Internet of ThingsThe Eclipse M2M IWG and Standards for the Internet of Things
The Eclipse M2M IWG and Standards for the Internet of ThingsWerner Keil
 
JSR 363 - The Answer to Life Science and the Internet of Everything
JSR 363 - The Answer to Life Science and the Internet of EverythingJSR 363 - The Answer to Life Science and the Internet of Everything
JSR 363 - The Answer to Life Science and the Internet of EverythingWerner Keil
 
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING JUBAIL UNIV.docx
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING JUBAIL UNIV.docxDEPARTMENT OF COMPUTER SCIENCE & ENGINEERING JUBAIL UNIV.docx
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING JUBAIL UNIV.docxsimonithomas47935
 
Standards for the Future of Java Embedded (16:9)
Standards for the Future of Java Embedded (16:9)Standards for the Future of Java Embedded (16:9)
Standards for the Future of Java Embedded (16:9)Werner Keil
 
Standards for the Future of Java Embedded
Standards for the Future of Java EmbeddedStandards for the Future of Java Embedded
Standards for the Future of Java EmbeddedWerner Keil
 
Running Head WINDOWS AND LINUX 1WINDOWS AND LINUX12.docx
Running Head WINDOWS AND LINUX     1WINDOWS AND LINUX12.docxRunning Head WINDOWS AND LINUX     1WINDOWS AND LINUX12.docx
Running Head WINDOWS AND LINUX 1WINDOWS AND LINUX12.docxjeffsrosalyn
 
Cigdem gencel persistence in poor estimating in software engineering- whys an...
Cigdem gencel persistence in poor estimating in software engineering- whys an...Cigdem gencel persistence in poor estimating in software engineering- whys an...
Cigdem gencel persistence in poor estimating in software engineering- whys an...oxwocs
 
MOBILE PHONE SENSORS META-MODEL
MOBILE PHONE SENSORS META-MODELMOBILE PHONE SENSORS META-MODEL
MOBILE PHONE SENSORS META-MODELijasuc
 
MOBILE PHONE SENSORS META-MODEL
MOBILE PHONE SENSORS META-MODELMOBILE PHONE SENSORS META-MODEL
MOBILE PHONE SENSORS META-MODELijasuc
 
Error Isolation and Management in Agile Multi-Tenant Cloud Based Applications
Error Isolation and Management in Agile Multi-Tenant Cloud Based Applications Error Isolation and Management in Agile Multi-Tenant Cloud Based Applications
Error Isolation and Management in Agile Multi-Tenant Cloud Based Applications neirew J
 

Similar to Werner Weil: UCUM - epicenter 2010 (20)

Mr. Keil Werner - UOMO 2011
Mr. Keil Werner - UOMO 2011Mr. Keil Werner - UOMO 2011
Mr. Keil Werner - UOMO 2011
 
M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)
M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)
M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)
 
M4M 2 the Rescue of M2M - Eclipse DemoCamps Kepler 2013
M4M 2 the Rescue of M2M - Eclipse DemoCamps Kepler 2013M4M 2 the Rescue of M2M - Eclipse DemoCamps Kepler 2013
M4M 2 the Rescue of M2M - Eclipse DemoCamps Kepler 2013
 
M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013
M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013
M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013
 
geecon 2013 - Standards for the Future of Java Embedded
geecon 2013 - Standards for the Future of Java Embeddedgeecon 2013 - Standards for the Future of Java Embedded
geecon 2013 - Standards for the Future of Java Embedded
 
Software Requirements and Design Process in the Aerospace Industry
Software Requirements and Design Process in the Aerospace IndustrySoftware Requirements and Design Process in the Aerospace Industry
Software Requirements and Design Process in the Aerospace Industry
 
Applying Drools in Assistive Technology
Applying Drools in Assistive TechnologyApplying Drools in Assistive Technology
Applying Drools in Assistive Technology
 
IJET-V3I2P15
IJET-V3I2P15IJET-V3I2P15
IJET-V3I2P15
 
Automatic Test Generation for Space
Automatic Test Generation for SpaceAutomatic Test Generation for Space
Automatic Test Generation for Space
 
The Eclipse M2M IWG and Standards for the Internet of Things
The Eclipse M2M IWG and Standards for the Internet of ThingsThe Eclipse M2M IWG and Standards for the Internet of Things
The Eclipse M2M IWG and Standards for the Internet of Things
 
JSR 363 - The Answer to Life Science and the Internet of Everything
JSR 363 - The Answer to Life Science and the Internet of EverythingJSR 363 - The Answer to Life Science and the Internet of Everything
JSR 363 - The Answer to Life Science and the Internet of Everything
 
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING JUBAIL UNIV.docx
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING JUBAIL UNIV.docxDEPARTMENT OF COMPUTER SCIENCE & ENGINEERING JUBAIL UNIV.docx
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING JUBAIL UNIV.docx
 
Standards for the Future of Java Embedded (16:9)
Standards for the Future of Java Embedded (16:9)Standards for the Future of Java Embedded (16:9)
Standards for the Future of Java Embedded (16:9)
 
The OHF Legacy
The OHF LegacyThe OHF Legacy
The OHF Legacy
 
Standards for the Future of Java Embedded
Standards for the Future of Java EmbeddedStandards for the Future of Java Embedded
Standards for the Future of Java Embedded
 
Running Head WINDOWS AND LINUX 1WINDOWS AND LINUX12.docx
Running Head WINDOWS AND LINUX     1WINDOWS AND LINUX12.docxRunning Head WINDOWS AND LINUX     1WINDOWS AND LINUX12.docx
Running Head WINDOWS AND LINUX 1WINDOWS AND LINUX12.docx
 
Cigdem gencel persistence in poor estimating in software engineering- whys an...
Cigdem gencel persistence in poor estimating in software engineering- whys an...Cigdem gencel persistence in poor estimating in software engineering- whys an...
Cigdem gencel persistence in poor estimating in software engineering- whys an...
 
MOBILE PHONE SENSORS META-MODEL
MOBILE PHONE SENSORS META-MODELMOBILE PHONE SENSORS META-MODEL
MOBILE PHONE SENSORS META-MODEL
 
MOBILE PHONE SENSORS META-MODEL
MOBILE PHONE SENSORS META-MODELMOBILE PHONE SENSORS META-MODEL
MOBILE PHONE SENSORS META-MODEL
 
Error Isolation and Management in Agile Multi-Tenant Cloud Based Applications
Error Isolation and Management in Agile Multi-Tenant Cloud Based Applications Error Isolation and Management in Agile Multi-Tenant Cloud Based Applications
Error Isolation and Management in Agile Multi-Tenant Cloud Based Applications
 

Recently uploaded

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Recently uploaded (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Werner Weil: UCUM - epicenter 2010

  • 1.
  • 2. Trinity College, Dublin 08 – 11 June 2010 UCUM Unified Code for Units of Measure Werner Keil Agile Coach, emergn
  • 3. Our Goal Avoiding Interface and Arithmetic Errors
  • 4. Emphasis Most of today’s technologies including the current Java Language Releases lack support for common non-trivial Arithmetic problems like Unit Conversions.
  • 5. Summary Present Situation Historic IT Errors and Bugs Cause of Conversion Errors Proposed Changes Unit and Measure Support Type Safety Case Studies Demo Q&A
  • 6. What do these disasters have in common? Patriot MissileThe cause was an inaccurate calculation of the time since boot due to a computer arithmetic error. Ariane 5 ExplosionThe floating point number which a value was converted from had a value greater than what would be represented by a 16 bit signed integer.
  • 7. What do these disasters have in common? Mars Orbiter Preliminary findings indicate that one team used English units (e.g. inches, feet and pounds) while the other used metric units for a key spacecraft operation. NASA lost a $125 million Mars orbiter because a Lockheed Martin engineering team used English units of measurement while the agency's team used the more conventional metric system for a key spacecraft operation This also underlines the added risk when 3rd party contractors are involved or projects are developed Offshore
  • 8. NASA “Star Wars” Experiment, 1983 23rd March 1983. Ronald Reagan announces SDI (or “Star Wars”): ground-based and space-based systems to protect the US from attack by strategic nuclear ballistic missiles.
  • 9. 1985 Mirror on underside of shuttle SDI Experiment: The Plan Big mountain in Hawaii
  • 10. 1985 SDI Experiment: What really happened
  • 12. NASA Mars Climate Orbiter, 1999
  • 13. Unit Tests did not find these Errors All previous example illustrate three categories of errors difficult to find through Unit Testing: Interface Errors (e.g. millisecond/second, radian/degree, meters/feet). Arithmetic Errors (e.g. overflow). Conversion Errors.
  • 14. Causes of Conversion Errors Ambiguity on the unit Gallon Dry / Gallon Liquid Gallon US / Gallon UK Day Sidereal / Day Calendar ... Wrong conversion factors: static final double PIXEL_TO_INCH = 1 / 72; double pixels = inches * PIXEL_TO_INCH
  • 15. Present Situation Java does not have strongly typed primitive types (like e.g. Ada language). For performance reasons most developer prefer primitive types over objects in their interface. Primitives type arguments often lead to name clashes (methods with the same signature)‏
  • 16. UCUM Unified Code for Units of Measure The Unified Code for Units of Measure is a code system intended to include all units of measures being contemporarily used in international science, engineering, and business. The purpose is to facilitate unambiguous electronic communication of quantities together with their units. The focus is on electronic communication, as opposed to communication between humans. A typical application of The Unified Code for Units of Measure are electronic data interchange (EDI) protocols, but there is nothing that prevents it from being used in other types of machine communication. How does it relate?
  • 17. UCUM Unified Code for Units of Measure The Unified Code for Units of Measure is inspired by and heavily based on ISO 2955-1983 ANSI X3.50-1986 HL7's extensions called ISO+
  • 18. JSR-275 Base Classes and Packages Namespace: javax.measure.* Only one interface and one abstract class Measurable<Q extends Quantity> (interface)‏ Measure<V, Q extends Quantity> (abstract class)‏ Three sub-packages Unit (holds the SI and NonSI units)‏ Quantity (holds dimensions mass, length)‏ Converter (holds unit converters)‏
  • 19. Units and Systems of Unit
  • 20. Unit Operations Results with Same Dimension Different Dimension Binary Operations Binary Operations plus (double) or (long) root(int) times(double) or (long) power(int) divide(double) or (long) times(Unit) compound(Unit) divide(Unit) Unary Operations inverse() © 2007-2009 Creative Arts & Technologies
  • 21. The King is Dead… Units of Measure API Namespace: org.unitsofmeasure.* Only interfaces and one abstract class Measurable<Q extends Quantity> (interface)‏ Measure<V, Q extends Quantity> (abstract class)‏ Two sub-packages Quantity (holds dimensions mass, length) Util (misc items and helpers)
  • 22. JSR-256 Mobile Sensor API Namespace: javax.microediton.sensor* Focusing on Sensors, but it got a minimalistic Unit API “in the closet” Unit Essentially an SI singleton holding relevant unit constants, too. ChannelInfoHolding name, accuracy, data type,measurement ranges, scale and unit MeasurementRangeRange of possible values from minimum to maximum
  • 24. JSR-256 Sensor Groups Context types categorize sensors into three groups: ambient, sensors measuring some ambient property of the environment device, sensors measuring properties related to the device user, sensors measuring some function of the user By using context types, it is possible to find, for example, user-related sensors for fitness, or ambient sensors for smart home controlling. Although the granularity of this level does not qualify the sensors very precisely, still in some cases it provides the way to make the distinction, for example, cf. air thermometer (ambient) / clinical thermometer (user).
  • 25. JSR-256 Quantity The quantity provides a more precise qualifier. The unit and the quantity has a close relation. Some quantities are listed in tables of Unit class. When the quantity and context type is known, it is often easy to guess the full purpose of the sensor. Some examples are given here: Quantity: electric_current + context type: ambient = sensor measuring electric current, amperemeter Quantity: catalytic_activity + contex type: ambient = sensor measuring catalytic activity
  • 26. OSGi Measurement Package Namespace: org.osgi.util.measurement SI only Unit API “in the closet” Unit Essentially an SI singleton holding relevant unit constants, too. MeasurementRepresents a value with an error, a unit and a time-stamp. StateGroups a state name, value and timestamp.
  • 27. Eclipse project UOMo One Unit Framework to Measure them All Namespace: org.eclipse.uomo.* Two main areas Static Type Safe Units of Measure Support Based on Units of Measure API On top of ICU4J, the Globalization standard at Eclipse and others (Android, GWT, Google Financial, etc.) UCUM Reference Implementation Successor to Eclipse OHF UCUM Bundle
  • 28. Case Study: Monetary System Monetary systems are not subject to the JSR, but this illustrates, how easily the framework can be extended to non physical or scientific quantities. Such extension can be valuable by leveraging the framework’s capabilities (formatting, conversion,…) and applying its usefulness beyond what e.g. java.util.Currency now has to offer.
  • 31. Trading Application Example What happens, if we use built in java.util.Currency and Standard JSP formats
  • 32. Money Demo (1) We’ll extend MoneyDemo to show fuel costs in Indian Rupees. First by adding a new currency to MonetarySystem. // Use currency not defined as constant (Indian Rupee). public static final DerivedUnit<Money> INR= monetary(new Currency(„INR") ); Then add this line to MoneyDemo.(also change static import to MonetarySystem.*; ) UnitFormat.getInstance().label(INR, „Rp");
  • 33. Money Demo (2) Next set the Exchange Rate for Rp. ((Currency) INR).setExchangeRate(0.022); // 1.0Rp = ~0.022 $ Note, the explicit cast is required here, because getUnits() in SystemOfUnits currently requires a neutral <?> generic collection type.
  • 34. Money Demo (3) Then we add the following line to the “Display cost.” section of MoneyDemo System.out.println("Trip cost = " + tripCost + " (" + tripCost.to(INR) + ")"); Resulting in the additional output: Trip cost = 87.50 $ (3977.26 Rp)
  • 35. Links JCP – Java Community Process http://www.jcp.org UCUM http://www.unitsofmeasure.org Units of Measure API http://www.javaforge.com/project/uom
  • 36. Questions werner@emergn.com Or info@catmedia.us Twitter: @wernerkeil