Weitere ähnliche Inhalte Ähnlich wie JSR 363 - The Answer to Life Science and the Internet of Everything (20) Mehr von Werner Keil (20) Kürzlich hochgeladen (20) JSR 363 - The Answer to Life Science and the Internet of Everything1. JSR 363
The Answer to Life Science and the
Internet of Everything
Based on Images
2. Overview
• Introduction
• Prior Efforts
• OSGi Measurement
• JCP (JSR-108, JSR-256, JSR-275)
• Eclipse UOMo
• Units
• Other Bundles (UCUM, Business)
• JSR-363
• IoT
• Smart Home
• QS, Wearable
• Demo
•Q&A
2 © 2007-2014 Creative Arts & Technologies
3. Who am I?
Werner Keil
• Consultant – Coach
• Creative Cosmopolitan
• Open Source Evangelist
• Software Architect
• JCP EC Member
• Eclipse UOMo Project Lead
• JSR-363 Co Spec Lead
• DevOps Guy …
Email werner@catmedia.us
3 © 2012-2014 Creative Arts & Technologies
Twitter @wernerkeil
4. Type-Safety
• Java does not have strongly typed base types
(like e.g. Ada or Smalltalk).
• This could change around Java 9 to 11
(based on Oracle Road Map so far, e.g. Project Valhalla)
• For performance reasons most developer prefer
primitive types over objects in their interface.
• Primitive type arguments can more easily lead to
name clashes (methods with the same signature)
or other problems (“Auto-Boxing”,…)
4 © 2007-2014 Creative Arts & Technologies
5. What do these disasters have in
common?
• Patriot Missile
The cause was an inaccurate calculation of the time since boot due to a
computer arithmetic error.
• Ariane 5 Explosion
Floating point number which a value was converted from had a value
greater than what would be represented by a 16 bit signed integer.
• Gimli Glider (near disaster)
Fuel loading was miscalculated through misunderstanding of the recently
adopted Metric System, replacing the Imperial System in Canada
5 © 2007-2014 Creative Arts & Technologies
6. 1983 | Gimli Glider
6 © 2007-2014 Creative Arts & Technologies Fotos: Wayne Glowacki | Wikia „Herr der Ringe“
7. NASA “Star Wars” Initiative, 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.
7 © 2007-2014 Creative Arts & Technologies
8. 1985
Mirror on underside of
shuttle
SDI Experiment:
The Plan
Big mountain in Hawaii
8 © 2007-2014 Creative Arts & Technologies
10. 1985 | Why it happened?
10 © 2007-2014 Creative Arts & Technologies
11. 1999 | Mars Climate Orbiter
11 © 2007-2014 Creative Arts & Technologies
12. 1999 | Mars Climate Orbiter (2)
• Mars Orbiter
Preliminary findings indicate that one team used US/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
• A credible source disclosed, there was a manual step with an outsourced person to
convert these calculations between the different teams, and NASA budget cuts caused
them to fire him and have the wrong, unpatched data transmitted!!!
• This also underlines the added risk when 3rd party contractors are involved or projects
are developed Offshore
12 © 2007-2014 Creative Arts & Technologies
13. Unit Tests wouldn‘t find these…
Despite their name
• All previous examples 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.
13 © 2007-2014 Creative Arts & Technologies Images based on © Copyright 2005, Touchstone Pictures
14. Causes of Conversion Errors
• Ambiguity on the unit
• Gallon Dry / Gallon Liquid - Gallon US / Gallon UK
• Day Sidereal / Day Calendar
• Foot in various regions, at least historically, see:
http://en.wikipedia.org/wiki/German_obsolete_units_of_measurement#Fu.C3.
9F_.28foot.29
• Degree Celsius / Degree Fahrenheit
• …
• Wrong conversion factors:
static final double PIXEL_TO_INCH = 1 / 72;
double pixels = inches * PIXEL_TO_INCH
14 © 2007-2013 Creative Arts & Technologies
15. What else do they have in common?
ALL OF THEM HAPPENED IN
MOBILE, REAL TIME OR EMBEDDED
SYSTEMS!
15 © 2007-2014 Creative Arts & Technologies
16. 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.
• Measurement
Represents a value with an error, a unit and a time-stamp.
• State
Groups a state name, value and timestamp.
• Some usage, e.g. by Automotive
► no further development by OSGi
16 © 2007-2013 Creative Arts & Technologies
17. JSR-108
Units Specification
• Namespace: javax.units.*
• Only one interface and one abstract class
• public class Dimension
• public class Quantity
• public class Unit<Q extends Quantity>
• Withdrawn by the Expert Group
17 © 2007-2012 Creative Arts & Technologies
18. 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.
JavaDoc: http://pandora.la/java/javadocs/sensor/javax/microedition/sensor/Unit.html
• MeasurementRange
Range of possible values from minimum to maximum
• ChannelInfo
Holding name, accuracy, data type,measurement ranges, scale and unit
► Dead Meat (few actual handsets and no vendors
except Nokia still use it, nor does Java ME Embedded)
18 © 2007-2013 Creative Arts & Technologies
19. JSR-275
Units Specification
• Namespace: javax.measure.*
• Only one interface and one abstract class
• public interface Measurable<Q extends Quantity>
• public abstract class Measure<V, Q extends Quantity>
• Three sub-packages
• quantity (holds dimensions mass, length)
• unit (holds SI and NonSI units)
• converter (holds unit converters)
19 © 2007-2014 Creative Arts & Technologies
20. JSR-275
Users and popular Downstream Projects
• JScience
• Groovy/Grails (DSLs e.g. for Healthcare, Unit Conversion,…)
• GeoAPI (OGC standard) and implementations, e.g. uDig
• Orbitz/Ebookers.com
• IEM (Emergency Management, Homeland Security)
• OpenEHR
• Parfait (Java Monitoring, part of Performance Co-Pilot - PCP)
► Rejected only by EC not Community
20 © 2007-2014 Creative Arts & Technologies, V2COM
21. JSR-275 | LocationTech
• uDig is a desktop
application
framework,
built with Eclipse
Rich Client (RCP)
• Internet: supporting
standards (WMS, WFS,
WCS, KML) …
• GIS: framework for
spatial data exploration
and analysis
• Based on JSR-275
http://locationtech.org/projects/technology.udig
21 © 2007-2014 Creative Arts & Technologies, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0
22. The King is Dead…
Units of Measurement API
• Namespace: org.unitsofmeasurement.*
• Only interfaces (and exception classes)
• public interface Quantity<Q extends Quantity<Q>>
• public interface Unit<Q extends Quantity<Q>>
• Three sub-packages
• quantity (holds dimensions mass, length,...)
• unit (holds units)
• service (holds services)
22 © 2007-2014 Creative Arts & Technologies
Walking
24. Eclipse 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 Measurement API
• On top of ICU4J, the Globalization standard at Eclipse and
others (Android, GWT, Google Financial, etc.)
• Prime UCUM Implementation
• Successor to Eclipse OHF UCUM Bundle
24 © 2007-2014 Creative Arts & Technologies
25. UOMo 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+
25 © 2007-2014 Creative Arts & Technologies
26. UOMo Business
JSR 354 Implementation
“Sisu” equivalent for 354 if you want
• ICU4J based implementation
of types like
• CurrencyUnit
• MonetaryAmount
• CurrencyConversion
• ExchangeRate
• …
• Bridge to Unit-API where possible for cross-quantity arithmetic
(e.g. “$ per gram CO² per mile”)
26 © 2007-2014 Creative Arts & Technologies
27. JSR-363
Units of Measurement API (1.0)
• Namespace: javax.measure.*
• Only Interfaces and Base Exceptions
• public interface Dimension
• public interface Measurement<Q extends Quantity<Q>, V>
• public interface Quantity<Q extends Quantity<Q>> extends
Measurement<Q, Number>
• public interface Unit<Q extends Quantity<Q>>
• A “functional” Sub-package
• function (contains functional interfaces, especially for Java 8 Lambdas)
27 © 2007-2014 Creative Arts & Technologies
28. JSR-363
Units of Measurement API (1.0)
• All other packages are OPTIONAL
• format (contains Formatters und Parser)
• quantity (contains dimensions like Mass, Length,...)
• spi (contains Service Provider Interface)
28 © 2007-2014 Creative Arts & Technologies
29. Internet of Things
Transportation & Logistics
29 © 2007-2014 Creative Arts & Technologies | Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0,
Logistics
Medical &
Healthcare
Industrial &
Energy
Communication
Infrastructure
Security & Surveillance
Internet
of Things
Some IoT Use Cases
30. IoT | Health Use Cases
Medical Services Gateway
Internet
of Things
Communication
Infrastructure
Smart
Pill
Boxes
Near field
Heartbeat
Sensor
Weight
Scales
Blood
Pressure
Medical
Smart
Services
Gateway
Blood
Sugar
30 © 2007-2014 Creative Arts & Technologies | Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0,
31. IoT | Smart Home
31 © 2012-2014 Creative Arts & Technologies Foto: ARD Degeto/NDR/Marc Meyerbroeker
32. IoT | Smart Home Actual Showcase
32 © 2012-2014 Creative Arts & Technologies
34. Quantified Self
Smart Watch, Health and Fitness Apps
34 © 2012-2014 Creative Arts & Technologies Bild: L'Atelier
36. Quantified Self | Heart of Glass
JavaOne 2013
•A Heart Monitor remotely
accessible from devices
like Google Glass or your
favorite Mobile Browser
• Part of Java Embedded
Challenge at JavaOne
36 © 2013-2014 Creative Arts & Technologies, V2COM
37. Quantified Self | Heart of Glass
Technologies we used
•Raspberry Pi | Things API
•RXTX (gnu.io)
• Polar Heart Sensor
• Java EE | HTML 5 (Tomcat/Glassfish)
•Google Glass (preferred) or other Web-enabled
Mobile devices
37 © 2013-2014 Creative Arts & Technologies, V2COM
| Unit-API
Hinweis der Redaktion Briefly discuss what a rich client is. This is an opportunity to talk about all the pretty pictures, how making a selection in one view can change the appearance of others, drag and drop, yadda, yadda, yadda…