IEEE Consumer Electronics Magazine - July 2015 - 87
descriptions into alignment if there is
sufficient interest just as we now use
USB as a common power supply.
The good news is that there seems
to be a convergence on the ingredients
in this soup that are giving us the
opportunity for an #APIFirst approach
as an alternative to the idea that we
need to build and maintain an app for
each purpose on each platform.
Restful APis And the Rise oF
JAVAsCRiPt oBJeCt notAtion
As a software guy, I want to be able to
take advantage of existing devices rather
than build new devices for each purpose.
In 1997, my solution was open interfaces
using XML. Today, the world is discovering open interfaces using Java Script
Object Notation (JSON) instead in the
form of RESTful APIs with OAuth.
These acronyms are inherited from
common practices in exposing services
for Web set. We can use the same
interfaces for machine-to-machine
communications.
The end points are identified by universal resource identifiers (URIs). The
URL also specifies the message format,
with hypertext transport protocol
(HTTP) being the most common. It is
similar to an e-mail message and can
carry content in any format.
A Web page is an HTML message.
For data, we use XML, which is very
similar to HTML. Using JavaScript,
programmers figured out that they
could modify the HTML document
dynamically to retrieve data without
going to a new page. This technique
became formalized as XMLHttp. Over
time, the use of XMLHttp has evolved
to become the standard way to provide
APIs for Web services and, increasingly, devices.
XMLHttp is simply a transport for
any message format. Today, it is
increasingly common to use JSON.
JSON is simply the object notation
from JavaScript:
{
"First": "Joe",
"Last: "Random",
"Age": 34
}
It is simpler than XML and more
readable. You might also recognize it as
the notation used for CSS in HTML. It
nicely maps into the class notation in
common programming languages.
Both JSON and XML are represented as text strings. You don't need special
tools to read them. Because we use
HTTP as a generic transport, the message is passed directly to the device or
service without depending on intermediaries. This is very different from protocols like Bluetooth, which depend on
every intermediary cooperating. In fact,
messages should be encrypted to protect
the end-to-end relationship.
The use of XMLHttp has
evolved to become the
standard way to provide
APIs for Web services and,
increasingly, devices.
JSON notation can also be used to
describe JSON objects. This is one reason for using TypeScript (a superset for
JavaScript). One can declare
interface Name {
First: string;
Last: string;
Age: number:
}
Integrated development environments can offer hinting and help manage code as it evolves and is shared
with others. They are a useful way to
exchange structured data over other
transports such as WebSockets (a bidirectional streaming protocol for
HTML5) and MQTT (a queued message protocol).
JSON is easy to use with various programming languages. For example, it is
a good match for anonymous types in
C#. Examples of programming languages are provided in [2]. The semantics of
the data are described using JSON [3]
("ld" in the URL cited in [3] stands for
link data).
Another part of this mix is OAuth [4],
which is a capability-like mechanism that
can be used in conjunction with HTTPS
(encrypted HTTP) for authorization.
OAuth is part of an evolving set of practices that are loosely coupled and is
becoming the norm for authorization for
Web services.
OAuth is a mechanism that does
not solve the problem of who you
should trust but provides one way to
give those you trust a way to present
credentials. This ability to evolve and
share is what gives this community its
energy and the ability to converge on a
common set of good ideas. The simple
protocols facilitate cooperation and
learning much as the Internet packet
protocols facilitate connectivity.
In addition to the sites publishing
APIs, we have sites like http://GitHub.
com with utilities and sample code that
take advantage of these APIs.
We are still at an early stage. Many
of the APIs go to Web sites rather than
directly to devices. This currently
works well enough because today's
Internet is too reliable, and we have
become overly dependent on being
connected all the time. As a result, we
cannot turn on the lights in our homes
if the Internet connection goes down.
We need resilience rather than brittle
dependencies. These dependencies are
also about business as we see companies trying to turn your door lock into a
service with a monthly fee.
OAuth itself is a mechanism for
trust relationships, but it does not dictate our policies. Note that I am using
the word trust rather than security to
emphasize that we need a far more
nuanced approach than secure/insecure.
We cannot just put a border around the
stuff we want to protect.
Trust relationships do not necessarily correspond to physical boundaries.
One well-publicized attack, on Target,
happened because the HVAC system
inside the security perimeter was compromised. In terms of APIs, a security
perimeter represents an implicit policy,
determining which relationships are
feasible and which are not.
If I want to turn on a light, it is not
enough to say "that bulb." I need to be
explicit and give the current network
address of the bulb and which network it
july 2015
^
IEEE ConsumEr ElECtronICs magazInE
87
http://GitHub
Table of Contents for the Digital Edition of IEEE Consumer Electronics Magazine - July 2015
IEEE Consumer Electronics Magazine - July 2015 - Cover1
IEEE Consumer Electronics Magazine - July 2015 - Cover2
IEEE Consumer Electronics Magazine - July 2015 - 1
IEEE Consumer Electronics Magazine - July 2015 - 2
IEEE Consumer Electronics Magazine - July 2015 - 3
IEEE Consumer Electronics Magazine - July 2015 - 4
IEEE Consumer Electronics Magazine - July 2015 - 5
IEEE Consumer Electronics Magazine - July 2015 - 6
IEEE Consumer Electronics Magazine - July 2015 - 7
IEEE Consumer Electronics Magazine - July 2015 - 8
IEEE Consumer Electronics Magazine - July 2015 - 9
IEEE Consumer Electronics Magazine - July 2015 - 10
IEEE Consumer Electronics Magazine - July 2015 - 11
IEEE Consumer Electronics Magazine - July 2015 - 12
IEEE Consumer Electronics Magazine - July 2015 - 13
IEEE Consumer Electronics Magazine - July 2015 - 14
IEEE Consumer Electronics Magazine - July 2015 - 15
IEEE Consumer Electronics Magazine - July 2015 - 16
IEEE Consumer Electronics Magazine - July 2015 - 17
IEEE Consumer Electronics Magazine - July 2015 - 18
IEEE Consumer Electronics Magazine - July 2015 - 19
IEEE Consumer Electronics Magazine - July 2015 - 20
IEEE Consumer Electronics Magazine - July 2015 - 21
IEEE Consumer Electronics Magazine - July 2015 - 22
IEEE Consumer Electronics Magazine - July 2015 - 23
IEEE Consumer Electronics Magazine - July 2015 - 24
IEEE Consumer Electronics Magazine - July 2015 - 25
IEEE Consumer Electronics Magazine - July 2015 - 26
IEEE Consumer Electronics Magazine - July 2015 - 27
IEEE Consumer Electronics Magazine - July 2015 - 28
IEEE Consumer Electronics Magazine - July 2015 - 29
IEEE Consumer Electronics Magazine - July 2015 - 30
IEEE Consumer Electronics Magazine - July 2015 - 31
IEEE Consumer Electronics Magazine - July 2015 - 32
IEEE Consumer Electronics Magazine - July 2015 - 33
IEEE Consumer Electronics Magazine - July 2015 - 34
IEEE Consumer Electronics Magazine - July 2015 - 35
IEEE Consumer Electronics Magazine - July 2015 - 36
IEEE Consumer Electronics Magazine - July 2015 - 37
IEEE Consumer Electronics Magazine - July 2015 - 38
IEEE Consumer Electronics Magazine - July 2015 - 39
IEEE Consumer Electronics Magazine - July 2015 - 40
IEEE Consumer Electronics Magazine - July 2015 - 41
IEEE Consumer Electronics Magazine - July 2015 - 42
IEEE Consumer Electronics Magazine - July 2015 - 43
IEEE Consumer Electronics Magazine - July 2015 - 44
IEEE Consumer Electronics Magazine - July 2015 - 45
IEEE Consumer Electronics Magazine - July 2015 - 46
IEEE Consumer Electronics Magazine - July 2015 - 47
IEEE Consumer Electronics Magazine - July 2015 - 48
IEEE Consumer Electronics Magazine - July 2015 - 49
IEEE Consumer Electronics Magazine - July 2015 - 50
IEEE Consumer Electronics Magazine - July 2015 - 51
IEEE Consumer Electronics Magazine - July 2015 - 52
IEEE Consumer Electronics Magazine - July 2015 - 53
IEEE Consumer Electronics Magazine - July 2015 - 54
IEEE Consumer Electronics Magazine - July 2015 - 55
IEEE Consumer Electronics Magazine - July 2015 - 56
IEEE Consumer Electronics Magazine - July 2015 - 57
IEEE Consumer Electronics Magazine - July 2015 - 58
IEEE Consumer Electronics Magazine - July 2015 - 59
IEEE Consumer Electronics Magazine - July 2015 - 60
IEEE Consumer Electronics Magazine - July 2015 - 61
IEEE Consumer Electronics Magazine - July 2015 - 62
IEEE Consumer Electronics Magazine - July 2015 - 63
IEEE Consumer Electronics Magazine - July 2015 - 64
IEEE Consumer Electronics Magazine - July 2015 - 65
IEEE Consumer Electronics Magazine - July 2015 - 66
IEEE Consumer Electronics Magazine - July 2015 - 67
IEEE Consumer Electronics Magazine - July 2015 - 68
IEEE Consumer Electronics Magazine - July 2015 - 69
IEEE Consumer Electronics Magazine - July 2015 - 70
IEEE Consumer Electronics Magazine - July 2015 - 71
IEEE Consumer Electronics Magazine - July 2015 - 72
IEEE Consumer Electronics Magazine - July 2015 - 73
IEEE Consumer Electronics Magazine - July 2015 - 74
IEEE Consumer Electronics Magazine - July 2015 - 75
IEEE Consumer Electronics Magazine - July 2015 - 76
IEEE Consumer Electronics Magazine - July 2015 - 77
IEEE Consumer Electronics Magazine - July 2015 - 78
IEEE Consumer Electronics Magazine - July 2015 - 79
IEEE Consumer Electronics Magazine - July 2015 - 80
IEEE Consumer Electronics Magazine - July 2015 - 81
IEEE Consumer Electronics Magazine - July 2015 - 82
IEEE Consumer Electronics Magazine - July 2015 - 83
IEEE Consumer Electronics Magazine - July 2015 - 84
IEEE Consumer Electronics Magazine - July 2015 - 85
IEEE Consumer Electronics Magazine - July 2015 - 86
IEEE Consumer Electronics Magazine - July 2015 - 87
IEEE Consumer Electronics Magazine - July 2015 - 88
IEEE Consumer Electronics Magazine - July 2015 - 89
IEEE Consumer Electronics Magazine - July 2015 - 90
IEEE Consumer Electronics Magazine - July 2015 - 91
IEEE Consumer Electronics Magazine - July 2015 - 92
IEEE Consumer Electronics Magazine - July 2015 - 93
IEEE Consumer Electronics Magazine - July 2015 - 94
IEEE Consumer Electronics Magazine - July 2015 - 95
IEEE Consumer Electronics Magazine - July 2015 - 96
IEEE Consumer Electronics Magazine - July 2015 - 97
IEEE Consumer Electronics Magazine - July 2015 - 98
IEEE Consumer Electronics Magazine - July 2015 - 99
IEEE Consumer Electronics Magazine - July 2015 - 100
IEEE Consumer Electronics Magazine - July 2015 - 101
IEEE Consumer Electronics Magazine - July 2015 - 102
IEEE Consumer Electronics Magazine - July 2015 - 103
IEEE Consumer Electronics Magazine - July 2015 - 104
IEEE Consumer Electronics Magazine - July 2015 - Cover3
IEEE Consumer Electronics Magazine - July 2015 - Cover4
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20240102
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20231112
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20230910
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20230708
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20230506
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20230304
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20230102
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20221112
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20220910
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20220708
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20220506
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20220304
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20220102
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20211112
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20210910
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20210708
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20210506
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_20210304
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_202010
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_202009
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_202007
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_202004
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_202003
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_202001
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_201910
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_201909
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_201907
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_201905
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_201903
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_201901
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_201811
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_201809
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_201807
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_201805
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_201803
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_july2017
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_april2017
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_january2017
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_october2016
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_july2016
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_april2016
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_january2016
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_october2015
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_july2015
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_april2015
https://www.nxtbook.com/nxtbooks/ieee/consumerelectronics_january2015
https://www.nxtbookmedia.com