Sunday, 30 March 2014

Google App Engine - First try

Introduction

I own an Internet-enabled digital scale for weighing myself and measuring my impedance.

Architecture

Functional Requirements (FR):
  • I wish to store a backup of my scale measurements, for my own purposes
  • however, scale measurements must continue to be reported to the official website
I have several Non-Functional Requirements (NFR):
  1. needs to use Java (because that's what I do)
  2. the scale receiver uses a simple unencrypted proprietary protocol
  3. the program receiving data from the scale receiver can handle raw sockets (related to previous point)
  4. must scale easily
  5. must not cost any money (until a certain threshold of users is reached, obviously)
  6. must provide decent monitoring
  7. needs to have an extremely low amount of maintenance
  8. must be able to easily create/upgrade/extend the part that uses those measurements for stuff, without disrupting the core functionality of receiving measurements
  9. needs to have the Cool Tech Factor™
These dictate which kind of architecture to use:
  1. Google App Engine (NFR 1, 4, 5, 6, 7, 8 but fails 2 and 3, definitely allows for NFR 9)
  2. a simple socket server, receives measurements, sends them on to Google App Engine and the original website (NFR 2, 3, 5, 7, might fail 4 and 8, but perhaps not if we keep the amount of actual work done by the simple socket server to a minimum, definitely fails NFR 9)

Implementation

The "Daemon3" sends the results to the Google App Engine2, using a Java library1 to make a HTTP POST request.

Example of Use

In the upper-right corner of my blog, my current weight is visible. It is a first example of what is possible.

I am planning on providing, on my blog, a complete graph of my weight over time. Stay tuned.

For the "Daemon" in the picture, that is the socketproxy server I made first. See [3].

References

[1] Apache HTTP Components
https://hc.apache.org/
[2] Google App Engine
https://developers.google.com/appengine
[3] SocketProxy Server
http://randomthoughtsonjavaprogramming.blogspot.nl/2014/03/socketproxyserver.html

Tuesday, 25 March 2014

Java 8 - Launch!

I have just witnessed the Live Webcast1 of the Oracle Java 8 Launch. It seems that Java 8 is officially2 launched.

I hear Java 8 was already released in the wild on the 18th of March, but this seems to be the Live Webcast of the Launch. Introducing Java 8 was Mark Reinhold3, the Chief Architect of the Java Platform Group at Oracle.

He was joined by some well known Software Developers:
  • Brian Goetz, core Java Language Architect at Oracle.
  • Robert Vandette, Technical Lead for Mobile Edition, does Compact Profiles.
  • Roger Riggs, new Date and Time API. Spec lead of ME 8.
  • Richard Bair, Java Client Architect, JavaFX 8.
  • John Rose, JVM Architect.
Java 8 Powers the Internet Of Things
Some notes in the promotional blurb at the beginning of the webcast:
  • Nine Million Java Developers
  • #1 Development Platform
  • Increased Developer Productivity
  • Revolutionary Platform Release
Some non-exhaustive list of things available in the new release for Java 8:
  • Lambda Expressions
  • Streams
  • Type Annotations
  • Date and Time API
  • Compact Profiles
  • Nashorn Javascript Engine
Java 8 is a Community Technology
There are several Java 8 sessions available to watch at [1].

References

[1] Java 8 Launch Webcast
http://www.oracle.com/events/us/en/java8/index.html
[2] Java 8 Launch Webcast - Overview
http://eventreg.oracle.com/profile/web/index.cfm?PKWebId=0x637279c68
[3] Mark Reinhold’s Blog - JDK 8: General Availability
http://mreinhold.org/blog/jdk8-ga
Everything about Java 8
http://www.techempower.com/blog/2013/03/26/everything-about-java-8/
A deeper look into the Java 8 Date and Time API
http://www.mscharhag.com/2014/02/java-8-datetime-api.html