Day 4

JavaOne 2014
Written by Mark Stoetzer and Bram Patelski
Table of contents
The days before
3
Arrived at San Francisco
3
Conference locations
4
Day 1 User group sessions
4
Day 1 Keynote
5
Day 2 What’s up with modularity tutorial
6
Day 2 Technical sessions
7
Day 2 Future of development and the Cloud
8
Day 3 Tutorial Preventing errors before they happen 9
Day 3 Vert.x + WebSocket + Cloud =
Awesome Map Tracking
10
Day 3 Catch Me If You Can: Java on Wearables
10
Day 3 Stop! Or My Duke Will Shoot!
11
Day 4 FIRST Robotics
11
Day 4 The Seven Evil (Er, Agile) Skills
You Need to Succeed
12
Day 4 Groovy in 2014 and beyond
13
Day 5 Writing Highly Concurrent Polyglot
Applications with Vert.x
13
Day 4 Internet of Things magic show
14
Day 4 Everything You Wanted to Know About
Writing Async, Concurrent HTTP Apps in Java 14
Day 5 Transforming Business-Driven to
Technology-Driven Organizations
15
Day 4 Principles of Evolutionary Architecture
15
JavaOne 2014 Report
2
The days before
Written by Mark Stoetzer
JavaOne 2014 is coming up. First8 has to be there. Bram Patelski and I, Mark Stoetzer have the privilege of going to
javaone this year.
Before you can get there you have to do some preparations. Traveling to the USA seems simple enough: Get on a plane
in Amsterdam and get off the plane in San Francisco. However, you need a so called ESTA approval to be able to travel to
the USA. Furthermore you should not forget to reserve some seats on the plane such that you can sit next to each other
(or take care of any other wishes you could have concerning seating). If you have any dietary eating restrictions, you
should adjust your plane meals beforehand. In my case I have food allergies for eggs. Previous plane meal experiences
like fruit only didn’t work for me, so this time I am trying the vegan meal.
Of course the above is not the only thing that is important. Your bags have to be packed with all the things you would
normally bring with you on a holiday. When traveling with a laptop or any other device take care that you can actually
plug it in on the other side of the ocean. It would be rather disappointing (if not costly) if you could not use those devices
when you are there.
To make the most of JavaOne itself, it is crucial that you reserve a seat for the sessions that you want to attend. If you
don’t do so and all the seats are reserved for the session, you have to wait in a line and hope that people that have
reserved seats are absent. When you aren’t at the session 10 minutes before the start, the reservation is cancelled.
Considering the consequences, we created a schedule on the JavaOne site reserving seats for the sessions we would like
to go to. For me personally, there were some sessions of which all seats are already reserved, so let’s hope I can get in.
The only thing we have to keep in mind during JavaOne is to be on time at the sessions. Departure time! Off we go to
San Francisco (SF).
Arrived at San Francisco
Written by Bram Patelski
Mark & I met on Schiphol around 7:00. At Schiphol after checkin, we noticed
about half the plane were Oracle Open World or JavaOne attendees. We met
Robbrecht van Amerongen from AMIS and talked to some more OOW people.
The flight was a pleasant though long flight of about 3 movies. In San Francisco,
we grabbed our luggage and drove in a taxi to the hotel.
Tip: when paying with creditcard in a hotel, make sure your credit-space is sufficient. We had to split it on two creditcards, but eventually that wasn’t a problem.
We dropped our luggage in the room and said Hi to Robbrecht and Lucas Jellema,
who just arrived at the hotel. Walked to the Moscone convention center to
register and get the goodie-bag, which this early took just a few minutes.
Hooray for 10’s of registration-desks with no line at all. The goodie-bag was a nice
backpack with lunch-tickets and a drinking bottle. Oracle didn’t save on this one
I guess.
We then strolled around the nearby cinema area for a drink and walked around the shopping streets and Market street to
get an early impression. For me, there’s a lot of contrast and busy people in the streets. I really need to adjust to a city like
this, since I’m used to Eindhoven or Nijmegen. But we’ll see how I fare at the end of the week.
JavaOne 2014 Report
3
Conference locations
Written by Mark Stoetzer
To get a feeling of the ground we have to cover, most JavaOne sessions are at the Hilton hotel and Parc 55 hotel, which
are near union square (this is also where most of the expensive fashion shops are located).
Both hotels are located at Ellis street.
When walking east from there, crossing the market street (a lot of buses and trams drive over this street) you will encounter the Moscone center. This is the third main location and it is also where most of the oracle open world sessions are
held (yes it is huge, hosting over 60000 people ).
Although the venues are all in walking distance 10 minutes max, while switching rooms from session to session we have
to cover a lot of ground.
Day 1 User group sessions
Written by Bram Patelski
The first day of JavaOne2014 the main sessions are user group sessions. After asking getting directions of about 3 people
we arrived just in time for the first session (not in time for possible reservations though) entering through the wrong
door. You have to have your badge scanned to look if if you are allowed to go in (dependent on seat reservation). The
room was not nearly filled completely, what you would expect with a full booked room. But considering it is early in the
morning I could think that someone skips this session. The reservation system we encountered today was not what we
expected. Today it was somewhat chaotic, a lot of rooms changed. Because of this the time between sessions was too
short resulting in that everyone was not at the session 10 minutes before starting. Therefore reservations were not really
applicable.
Avatar.js
First session of the day: Avatar.js. This should have been a dual-speaker session, but one of the speakers was late. Eventually his partner started the session. He was a Russian speaker, very nervous and excused him for his bad English. He had a
very hard time telling his story. From what we understand, Avatar.js is a JavaScript library that uses the same technology
to run Node.js, but from the Nashorn JavaScript engine available in Java 8 VM. In the demo, he used the module pdf2json
to convert a pdf document to a JSON object.
Controlling Robots with Java and ROS
Robots After coming in with a cap and a hat and the announcement that it will probably be the most unorganized
session we will see this JavaOne, the tone was set. Ean Schuessler, the speaker, was very enthusiastic and funny. They
brought a robot named Juggie, which was basically their User group mascotte in robot form to demonstrate what you
can achieve with simple parts (the robot body was actually a toy robot) that you can get at ebay relatively cheap and
using a raspberry pi.
The talk is about about ROS, Robot operating system. ROS is conceptually the same as a message bus. It has topics to
establish a publish subscribe kind of communication. It supplies service functionality with RPC. Also it incorporates a
parameter service with key value pairs on which events can trigger if a value is changed. ROS is platform unaware and
uses concepts similar to JMS and JNDI.
Open source libraries like Sphynx 4 (voice recognition), OpenDial (Interactive voice response mechanism), Faceshift (tcp
string with facial expression commands) and Blender (Visualization, emulation and simulation of motions by robotics)
can be used to create a human like robot.
The biggest challenge was to establish the build tools. The java part was actually not that hard. Combining a RaspBerry
Pi with ROS was actually very hard, mainly because it was not documented well. Communication between c++ and java
was tricky and needed specific structures to be able to work. Furthermore he advised to think about building the minimal viable product.
When you start building a robot visit the site www.schu.es. It contains a lot of useful information. Ean is willing to help
anyone with questions on robots.
JavaOne 2014 Report
4
Lambda’s and Laughs
Speaker of Lamda’s and laughs is Jim Bethancourt. Because of the large number of people that wanted to attend
this session, it was moved to another room. It took a while for all the people to switch to the other room. I was on the
waiting-­list, but I scooped in. Jim started with some warm-up talk while people were still getting into the room, with a
few nerd-jokes and he discussed how to start a successful and fun Java User Group. He introduced a few funny experiments like stand-up comedy presentations, where you start an automated presentation where the slides auto-slide on
fast speed automatically and you have to keep up with that. Or do Java or nerd-based flash-mobs. The talk itself was basically an introduction to Java 8 Lambda’s, but littered with meme’s and pictures with audience interaction.
Robots, the Raspberry Pi, and Small Devices
Gosling talked about JavaSE running on an ARM processor, in a box on an unmanned solar-powered (robotic) boat.
The challenge here was, since these boat-robots are dropped in the Arctic, they just HAVE to work (and more specifically
have to work in salt water). So the only indicator for Gosling is the little green lightbulb in the corner of the screen. The
setup uses real-time data from the robot and graphics showing a map with GPS data from the robot. He then introduced
a number of speakers with examples of how Netbeans integrates and deploys Java embedded code to different devices
using Raspberry PI boards. A German speaker showed a project, where they built a status monitoring dashboard with
integration of Jenkins and Sonar data running on Raspberry Pi. Second (Spanish) speaker showed an interface connected
via the cloud to his Raspberry Pi in Spain. It ran Glassfish to provide an interface on the laptop to show the webcam on
a lamp at home and switch the lamp on and off using websockets. The lamp was located in Spain. Final speaker used
Netbeans to execute byte code in the cloud such that you could use it from anywhere (laptop, any smartphone AND
smartwatches etc.). Why? He was attacked by a robot while he was 16, because he had to stand in front of the robot to
hit <enter>. If only he was able to start the robot’s program from his phone or watch, that wouldn’t have happened.
Free Java Tools for Maven and Java EE
Five speakers contributed to this talk. A lot is about Netbeans and how it integrates with Maven. You can even easily
auto-refactor, eg. to migrate to Java 8 and refactoring to Lambda’s. In Netbeans with Maven, you can add static code
checking tools like Checkstyle, Findbugs and PMD. Then you can have Netbeans show warnings, but also fix the code.
Some tips:
1.Start with an empty-ruleset and add rules that matter to you. Generic rules-lists gives you 25k rules violations, which
you do not want to fix.
2.Run it first on your own code and fix your mistakes first, before showing how clean your code is to your colleagues.
New developers often start using Eclipse and the combination with Maven mostly using the terminal. It often delays
the build-cycle. Netbeans has native maven support, so in contrary to eclipse command line maven build and IDE
build give the same result.
Java champion Adam Bien talked about archetypes and code coverage. Netbeans has Maven Archetype with support
for searching archetypes or custom archetypes using a wizard. Netbeans also supports unit-testing with code-coverage
facilities marking lines that were covered in the unit test.
Finally there was a demo on how to use Maven and Netbeans to migrate a Java 6 project to Java 7 and replace GSON to
Jackson at the same time.
Day 1 Keynote
Written by Mark Stoetzer
JavaOne 2014 keynote
The title “Create the future” aims at involving kids already as the next generation
of Java developers. A group of kids was invited to the stage to show the fan made
with lego in a devoxx4kids session.
The Keynote started with pumping house music with rap-texts like “Java is everywhere” and “In the internet of everything, Java is the Glue”. Throughout the keynote they had a sort of scripted dialogue with other Oracle speakers and partners
on stage. Peter Utzschneider was the host for Java SE, Java ME and the embedded
versions and Cameron Purdy for Java EE. John Duimovich of IBM did a marketing
talk about the keyrole of Java in the landscape and finally Mark Reinhold about
the history, key values and future of java.
JavaOne 2014 Report
5
Coming directly to the bare core of the keynote, it did not really contain any new subjects. Java 8 features were spoken
of in great length as well as features in Java EE 7, ME and the embedded versions. Adoption of SE embedded, ME and ME
embedded is still ongoing and remains a focus point. They stressed in great length that User groups and their involvement is crucial, also to continue in the open source direction under mentorship of oracle.
It was confirmed that project JigSaw should be shipped with Java 9 in 2016, but mentioned as side note that it will not
have a big impact compared to the impact of lambda expressions of Java 8.
Day 2 What’s up with modularity tutorial
Written by Mark Stoetzer
On Tuesday the technical meetings started with a tutorial on modularity from our Dutch colleagues of Luminus, Paul
Bakker and Bert Eertman. Here’s a summary of their presentation.
We see applications changing, growing and over time becoming more and more complex. With the adoption of Agile
software development, we don’t even know what the architecture would look like sprint after sprint. To be able to cope
with this growing complexity in software and architecture, we need flexibility. Modularity to the rescue. Modularity
comes from two concepts, that we’ve learned about early on in our education:
1. Prevent (tight) coupling
2. Promote cohesion
To illustrate, see the picture. The boxes in this picture can be considered modules,
in which coupling is allowed. But between boxes, it is not, instead cohesion on
interfaces should be found.
To be able to introduce modularity we need the following mechanisms to work:
1. Module system
2. Service lookups
Modules can be implemented in JAR’s with public parts (API’s / interfaces) and
private parts (implementation). This creates our module-system. Apart from this
module-system, we need a service lookup, to inject instances of the implementation whenever we need them. This is comparable to Spring or other dependency
injection frameworks.
Since modularity in Java (Jigsaw) will only be introduced in Java 9 (due in 2016), we currently have only one option for
runtime modularity: OSGI.
To illustrate their approach, Paul and Bert created a chat-like application using chat-rooms and messages. They used
Eclipse with the BndTools for OSGi plugin, which was all they needed. The technology stack included HTML5, AngularJS,
JAX-RS, RabbitMQ and JPA running on the Apache Felix OSGi implementation. Each module was implemented in two
separate packages, clearly separating the API part from the implementation. BndTools was then used to expose the API
for use and encapsulate the implementation. The AngularJS UI was added as a separate module as well, integrated
using REST services.
To illustrate the flexibility, Bert added an advertisement functionality to the
chat-client.
With Amdatu and BndTools it is quite easy to create OSGI modules and getting
them running. There are however some things you have to set up to make life a
lot easier. For example, monitoring the status of your modules is done by using
a subproject of Apache Felix, called Gogo. This is a command line tool that you
can use to monitor, stop and start modules. Furthermore, you have to think about
which classes to expose and which to keep private.
JavaOne 2014 Report
6
Some advantages using this combination of tools:
1.OSGI adds runtime deploying, which is very handy while developing code.
2.A Maven like repository can be used to get your libraries, but you can also just drag and drop your jar files in the local
repository (within eclipse)
3.With BndTools you can create multiple modules inside a single project
4.Amdatu contains very useful annotation for supporting for example JPA (@Transactional annotation).
With an @ServiceDependency annotation you can add your service dependencies from modules. You can also make
injections optional, resulting in an empty proxy when the dependency is not available.
Paul and Bert advised to create extra OSGI projects for running and integration testing the OSGI application.
Lastly, make sure you test your modular system using integration tests, because Unit-tests don’t proof that your modular
system actually works. It only tells you the API’s can be called.
For more information go to www.amdatu.org
Day 2 Technical sessions
Written by Mark Stoetzer
GS Collections and Java 8: Functional, Fluent, Friendly, and Fun
Goldman Sachs has supplied an extension on the collections framework already for ten years called GS collections. In
java 7 they already supplied sort of lambda expressions inspired on Smalltalk lambda expressions. The speaker Donald
Raab has been involved in the lambda expressions for Java 8 and have upgraded the GS collections framework to compete with the Java 8 lambda functionality. They distinguish their library on the following points:
1.Java 8 has by default lazy evaluation while GS collections has eager evaluation as default, but in GS collections you
can also specify lazy initialization. So you have a choice between eager and lazy evaluation
2.Java 8 Collections come basically with the same collections as are available in Java 7. GS collections add Hashmaps,
Multimaps, Bags in Readable, Mutable and Immutable forms.
3.Java 8 has primitive collections for int, double and long. GS collections have primitive collections for any combination
of primitives. For example there is a PrimitiveIntDoubleMap saying that the key has primitive type int and value has
type double. Mostly these collections improve on memory footprint.
4.New implemention of maps omitting the Entry object inside maps improving the memory footprint in HashMaps
and HashSets. However, using the entrySet method has impact on performance. Instead you should use a forEach
method
5.Because of the special definitions of collections, some convenience constructs for grouping, summing and partitioning can be created that result in less statements compared to Java 8.
GS collection is open source and the source and training (Kata) can be found on GitHub.
Conclusion: Java 8 with lambda’s is very nice, but GS Collections has a lot more. GS Collections is even more then the sum
of its rivals (Java 8, Guave, Trove and Scala)
Developing On-Device Java Mobile Apps for iOS…and Android Too
Shay Shmeltzer a representative of Oracle talks about the Oracle MAF framework. In essence they have created a JVM on
both the iOS and android platforms, such that you can run a java application natively. Like most hybrid mobile frameworks, you can also use HTML5 and JavaScript to create your app.
An application using Oracle MAF must be created using the MVC pattern with a JSF like view. Custom UI elements can
be created using apache Cordova (using HTML and JavaScript). For the eclipse and Jdeveloper IDE’s they have created
plugins to make it easy to create an Oracle MAF application. A nice touch is the visual page flow designer.
Although the concepts and ideas are good, it has some downsides:
1.First of all, it is not free or open source and therefore not in the mindset of most java developers.
2.Secondly as a passionate open source guy and Java enthusiast, I get the feeling you are forced to use oracle UI components. While the framework probably supplies a lot of nice components, it is hard to customize it. As an architect, I
like that it enables customization and collaboration with other Java libraries rather than that it limits your options.
JavaOne 2014 Report
7
In my perspective Oracle MAF forces the user to mostly use Oracle components and is therefore a limiting framework
(leaving a nasty taste for me personally)
3.The ME variant of the Java 1.4 spec can only be used. So back to the stone age when writing code for Oracle MAF.
Java Performance Is an (anti) Social Activity
Javaone champion Ben Evans gave the best talk this JavaOne yet pointing out social anti-patterns in the are of Java Perfomance and performance testing. The amount of sensible and right to the point statements was immense. If he would
give a workhop or course, count me in. He interacted with the audience as well making it a lively session. Additionally he
elaborated about ranging subjects like business aspects, assumptions, testing environment, JVM configuration, etc.
Performance testing is most of the time seen as a secondary activity. This originates from how people do things.
First come Remembering, understanding and applying. Performance testing/improving comes in the Analyzing, evaluating and creating phases as we do things.
Generally there are two types of performance problems:
•Outage (Complete loss of service)
•User experience degradation
Whether such problems are real problems for the application depends greatly on context, so the concept of “understanding your business” is crucial. If you have identified the quantifiable impact a performance problem has, you have a
business case.
In most cases an outage or user experience degradation costs a lot of money. It would cost significantly less if you would
execute performance tests from the start. However, you should watch out for incorrect tests and possibly unmeasured
root cause assumptions when evaluating these tests. Anti patterns like “Blame the donkey”, “UAT is my desktop”, “Production-like data is too hard”, “Fiddle with JVM switches”, “Tuning by folklore”, “Micro-analysis”, “Throw over the wall mentality” should be addressed.
In short to address these anti patterns you should test, measure, analyze, discuss and repeat the former steps. In doing
this, it is crucial to include any expert group that you have that is involved in the runtime of the system that you are testing (This includes that you have to have an overview of the system architecture).
Day 2 Future of development and the Cloud
Written by Bram Patelski
By Ken Sipe
The world of Continuous Delivery and dev-ops is in flux. In the client-server era
we had small apps running on big servers. In the cloud era, we instead have
big apps, running on multiple small servers.
An example of a big app, running on multiple small servers is Twitter. This Big
app used to be down from time to time, showing the Twitter “Fail whale”. But
for a while now, Twitter has been running without interruption This was not
(only?) because of the migration from dynamic language back to Java, but a
migration to Mesosphere.
Currently we are in a perfect storm within the topic of datacenters. Legacy
datacenters have everything “defined”. We install a datacenter and define a
number of VM instances. Scaling is done manually and is limited to the actual
hardware. Humans are involved, which is the single point of failure. Also, we
have a known IP and port for a resource, which is odd. Compare this to starting
an application on your PC, your PC never asks “Which CPU do you want to run
it on?”. A cloud-solution should be similar: resources should be a commonality, it should just be there when you need it.
You don’t care on what server it runs, or even how many. You care about uptime and efficient use of resources. But how
efficient are resources currently being used?
In the above picture, even elastic sharing is not 100% efficient. How can we achieve 100% efficiency 24/7? Think of it this
JavaOne 2014 Report
8
way: what if we give all important tasks immediate access to resources and have less important tasks get resource whenever available? We could even split resources over multiple priorities. Or provide minimum resource levels at given times.
Google already does resource-planning like this. Tier-0 processes are guaranteed to have resources. Then tier-1 processes
run when able, since those are first in line when resources are available. Lastly, tier-2 processes run on low prio, however
some can get a minimum resource level. Analytics for example, can be run in low activity hours, but during high activity,
we can allocate a minimum of 5% to it, so we have at least something. This gives a very flexible resource allocation, which
fits most any usage-scenario.
Mesosphere supplies that flexibility and ease of use. It allows the admin to start
tasks not on specific CPU’s or even VM’s, but on any CPU. Processes can be allocated to 0.1 CPU for instance, but it doesn’t matter which CPU it is. Mesosphere
is based on Docker, an open source Apache project for running software containers. It is based on Linux containers, which has been around since 2008. Back then,
it was rocket-science. Docker adds simplicity. VM’s are not context aware, they
don’t know what an admin may have changed. Therefore, each change requires
a new rollout of that changed VM in full (often GB’s in size). With Docker, changes
are just that: changes. You DON’T need to roll out an entire new VM-image, but
instead apply the (small, often KB-sized change) to all docker-images.
What’s even more easy, is how a developer may use Docker images. If the developer needs an external component, like a database, he can just say “docker run
couch-db” or something and it’s ready to go. There’s no need to install anything.
This could evolve in even more simplified scenario’s. What if our Eclipse just started a container (eg. Docker) with an
isolated runtime environment with Ruby, JVM, JBoss or whatever. It would start in tenths of a second and be fully isolated
and easy to share on teams.
Day 3 Tutorial Preventing errors before
they happen
Written by Mark Stoetzer
The tutorial ‘preventing errors before they happen by Werner Dietl from University of Waterloo is mainly about the
CheckerFramework’.
The aim of this framework is to introduce extra code checking at compile time. For this they have created an additional
loop in the java 8 compiler to do this. Additional annotation are introduced that can be attached to types (which is
possible since java 8). The below image contains all the currently available annotations of the CheckerFramework
He uses an example with Java Regular expressions. To add an extra check the @Regex annotation can be used on a String
variable saying the value assigned to this String must be a valid regex pattern. To satisfy this extra check, you have to do
some input validation using the utilities that ship with the Checker framework.
They have taken care to set the most suitable default behavior when enabling this static code check when calling javac.
Advantages of types systems are that you find bugs earlier, improve documentation and aid compilers, optimizers and
analysis tools. Disadvantages are that you have extra work writing the types and false positives are possible.
To make it possible that you specify the annotation from the CheckerFramework on existing classes from a Jar, they have
supplied a mechanism to attach annotations to a class from a jar file by specifing it in a separate stub file.
Furthermore because not everybody uses java 8 yet, they have thought of applying still these annotations, but using a
workaround to overcome the limitations or java 7.
Overall I am not completely convinced yet. Although the concepts are good, the way they have set it up at this moment
is not very practical in a bussines like situation. The current approach they have taken to create a special javac version
and the backwards compatibility mechanism to support java 7 seem not a very good solution and will cause problems.
Furthermore it seems not really maintainable the way it is now.
JavaOne 2014 Report
9
What they showed was a bare compiler command. Tools like a plugin in an IDE seems not to be available. He talked
about running with an without checker. To be able to make it usable I think you should be able to have some sort of
compiler profile in your IDE.
Another thing I am not really fond of is the fact that you have to use CheckerFramework classes for runtime validations
to satisfy your static code checking. By doing this, you use the CheckerFramework not only as static code checking tool
but also as runtime validation tool. The library must also be used in every part of your code. For libaries like this, I would
prefer to have it integrated in the JDK
All in all, I think the product is not mature enough yet and tools are missing to make the using it convenient.
Day 3 Vert.x + WebSocket + Cloud =
Awesome Map Tracking
Written by Mark Stoetzer
The first session about introduction to Vert.x is a very informal one by Steve Pousty inviting the audience to participate.
He also asked Tim Fox (creator of Vert.x) some questions if he didn’t know the answer. He also talked a bit about platform
as a service (openshift from red hat) in combination with Vert.x, but it was very minimal.
Vert.x is a revolutionary system replacing the classical application servers like Jboss and Tomcat with a different mechanism. Vert.x uses at most 2 threads per available CPU core in contrary to the thread per request pattern as is available in
traditional application servers. Each thread is basically an event loop handling events in the Vert.x system.
Vert.x identifies a basic element called a verticle. A verticle has its private classloader. All communication goes through
the event bus using events. This makes it possible to create verticles that have been programmed in different languages
on the JVM . Thus Vert.x is polyglot. Vert.x is especially suitable for the “microservices” trend that is currently happening.
Because each verticle has a different classloader, you can also not directly communicate. Furthermore because a verticle
runs inside an event loop, you may never call Thread.sleep (because it blocks processing other verticles.
Two types of verticles have been defined:
1.Default verticle, which is asynchronous
2.Worker verticle, which is synchronous
Under the hood Vert.x uses hazelcast, socks.js for websockets and jackson for JSON to name a few.
When Steve mentioned that Tim Fox also will give a presentation on Vert.x on thursday, I immediately reserved that
session. That’s how much I like the concepts that are used for Vert.x. A couple of weeks back I already saw a presentation
of Tim Fox on the internet, which made me very enthusiastic about Vert.x; not to mention that Tim Fox is a great speaker.
Day 3 Catch Me If You Can: Java on Wearables
Written by Mark Stoetzer
What are wearables? Wearables are miniature devices processed in for example earphones, clothing, insoles, glasses,
watches, etc. Thus generally they should be small and lightweight, but should also have a low power consumption.
Power management strategies like sleep mode and auto shutdown should be considered to minimize power usage.
Of course a wearable should also have connectivity using for example Cable, bluetooth, WIFI, cellular, etc. depending
on the use case. External influences should not be ignored, because these can potentially break the usefulness of your
wearables (water proof, drop proof, sweat proof ).
Gerrit Grunwald devised his own (do it yourself ) wearable devices for the jRunner project. In this project he wanted to
have heart rate monitoring, track the runner using GPS and be able to give instructions to the runner with text messages
(using Text To Speech).
JavaOne 2014 Report
10
Furthermore the information should be published such that a desktop app can be created as well.
He iteratively tried to find the right hardware components taking size and battery usage into account. Especially minimal
battery usage is difficult to achieve in combination with connectivity. Eventually he used his smartphone as connectivity
device that connects with the Raspberry Pi via low energy blue tooth (see below image for an overview).
For publishing data from a wearable devise, the MQTT protocol is most suited, because it is lightweight and basically
is a publish-subscribe protocol. By combining all these things we was able to realize all the things he wanted and is still
trying to optimize his setup in size. Next iteration he will try out a much flatter chip than that he currently uses.
Angela Caicedo, the second speaker had a different kind of approach in wearables. She integrated circuits into a vest like
leds and buttons.
She encountered more problems in the area of processing conductible wire into clothes and getting feedback upon
clicking buttons. To resolve the feedback problem she introduced vibrations upon button press and feedback through
self made glasses (with 320 x 200 resolution).
Day 3 Stop! Or My Duke Will Shoot!
Written by Mark Stoetzer
Daniel Koenig talked about Open Dolpin. Its main purpose is to use the same code to service any devices with data.
Open dolphin uses an MVC like architecture where the model is sent over a connection to a device. The view from the
MVC pattern can be a GUI or any possible device (sensor or actuator). Resolving the model must be developed device
dependent. Currently Java and JavaScript can be used as programming languages.
He demonstrated firing (toy) rockets by sound spike catched by tessel chip. Additionally he could turn the rocket installation by using a smartphone from someone in the crowd.
It was clear his aim for the talk was it to be fun with an extensive demo. Because of this the technical depth was very low.
For me personally the technical side was missing, making it unclear to me what the advantages and limitations are when
using open dolphin.
Day 4 FIRST Robotics
Written by Mark Stoetzer
FIRST is an initiative mainly related to getting kids in contact with programming. Four leagues based on age categories
are served with lego and parts in various complexity depending on age.
There is also a First competition. For this competition they get a set of parts and build from these parts a robot playing a
sort of game. Custom parts are also allowed. In the presented game example (last year) the robots had to interact with a
ball. In various ways points could be scored. The time that these robots have to be operational is not long approximately
3 minutes. To make it interesting , there is an autonomous part (10-15 seconds) and a part that has to be controlled from
a distance during such a robot game.
In previous years, the kids had to use a Texas instruments board with Java ME, CLDC 1.1 profile. From this year, the new
roboRIO is used, which comes with Java SE 8. Not only is this advantageous because of extra language constructs and
better performance, but also because of tooling like Visual VM that was not available in the previous configuration.
All and all, it is a nice way to get kids active with technology and will give kids that are into this sort of thing a nice time.
JavaOne 2014 Report
11
Day 4 The Seven Evil (Er, Agile) Skills You
Need to Succeed
Written by Bram Patelski
Peter van de Voorde from Belgium led us with a super villain inspired presentation through 7 skills that are related to
agile development. The following bullets sum up these skills and what it concerns
Invest
•Invest in your team
•Invest in yourself
•Invest in the future (5 years, 10 years)
Listening
•Be open to what people tell you
•You have 2 ears and 1 mouth, so listen twice as much as you talk
•Listen to body language
Empathy
•Walk a mile in someone else’s shoes, think about what it’s like
to be that someone, what’s his or her history, back ground etc.
•Be aware of cultural differences
•Everybody is different
•Know your strengths and weaknesses
Adaptability
•Always be ready to adapt
•Get out of your comfort zone, so you will learn and enlarge your comfort zone
•If it’s broken, Fix it
•Embrace change, opportunity ahead
Coaching
•Know the people who you coach, or those who coach you
•Take time to do it right
•Be a leader, don’t be a boss
•Autonomy, mastery, purpose: motivate people to work, give people purpose,
explain what you want to achieve WITH them. (book “Drive” from Daniel H. Pink)
•Coach the coach
•Do the beer test
Assertiveness
•Be assertive, not aggressive (don’t yell, listen and respond, stand your ground, but do it without being aggressive)
•Don’t be afraid
•Know your options (don’t be afraid to talk about and solve the issues)
•Have a plan
Creativity
•Say: “Yes and” instead of “Yes, but” (this nurtures creativity)
•Do some improvisational theatre
•Play (let yourself be coached by children playing)
•Read
See www.petervandevoorde.com/talks for his presentation
JavaOne 2014 Report
12
Day 4 Groovy in 2014 and beyond
Written by Bram Patelski
By Guillaume Laforge
Guillaume talked about the current version of Groovy, how this fits
in with the new Java 8 features and what the future will bring. This
year saw the release of Groovy 2.3. Next releases will be in 2015: 2.4
(start), followed (subject to change) by 2.5 (halfway). A 3.0 release is
planned for somewhere near the end of 2015, maybe early 2016
About 2.3:
This release already has JDK 8 support. Whenever you would use
Lambda’s, you can already use Groovy closures, even prior to Java
8. The main Groovy 2.3 feature is Traits. These resembles the JDK 8
default methods. Traits can be stateful, so it can not just only add
methods, but also features / attributes. Also, Traits can extend
other traits.
Other additions included:
•AST transformations, that inject specific functionalities using annotations. An example would be @Sortable, which
injects comparable and compareBy<attribute> methods.
•NIO2 module, which handles (easier) file access, reading and aligns these with the Path classes.
•JSON parser rebuild with 3x to 4x performance improvement over Jackson and different configurable parser modes
to optimize for different scenario’s.
•Markup template engine additions, can now do type-checking so you get errors on compile-time instead of runtime.
•GroovyDoc is now updated and the site has a new, more readable layout. Also the groovy-lang.org is in Beta.
Small bits about Groovy 2.4
There is already some support for Android applications, but this is only marginal and requires extra effort at the moment.
Groovy 2.4 should bring considerably better Android support to Groovy. There will also be support for Antlr 4 grammar.
Antlr 3 integration was skipped, but since v4 supports Java 8, the team decided to pick up Antlr support from v4 again.
Day 5 Writing Highly Concurrent Polyglot
Applications with Vert.x
Written by Mark Stoetzer
Tim Fox is the creator of Vert.x and a very good speaker.
Vert.x is a relatively low level framework to give you a strong basis without opinion (in the sense that it is not limiting
your options). Extensibility is therefore also one of the aspired characteristics. Vert.x was inspired by Erlang and Node.
js. Rather than just being a copy of node.js on the server side, it has been build up from scratch to include the desired
characteristics. Some characteristics from node.js Tim wanted to divert from:
•Programming language: Node.js can only be used when coding with JavaScript. Vert.x is mainly server side and
therefore uses the strength of the JVM to support multiple languages.
•Single threadedness: Node.js has inherently a single thread. In contrast to node.js, vert.x is a server side framework
and therefore the full capacity of the server(s) can be used. Maximizing CPU utility is one of the key goal.
Next to the Vert.x thread model, it is also kind of rebelling towards the traditional application servers in the sense that
simplicity is a key goal.
Vert.x is inherently asynchronous. The building blocks in Vert.x are verticles. A verticle runs within a single thread (it
is guaranteed that the same thread will be used). A verticle can only communicate with other verticles throught the
eventbus. JSON is the standard for communicating structured data between verticles, but you can define your own data
format if you want. The event bus is the nervous system of Vert.x and one of its strengths. However, you can use this
event bus in other ways, like connecting to it directly from the client, even in a clustered environment. While being the
JavaOne 2014 Report
13
strength, the event bus currently also has some weaknesses:
•Currently the assumption is that you are running on a trusted network. No security is in place to make sure the data
on the eventbus is confidential.
•When developing in Vert.x, you should know that all data passed to the event bus should be immutable (when
serializing). Otherwise, a copy will be made and you will not be looking at the same object.
•You might think that putting messages on the event bus is similar to messaging with a queue like ActiveMQ or
RabbitMQ. Though it has similarities, sending messages over the event bus is transient, meaning that there is no
transport guarantee.
Verticles can be run directly (without packaging first) from command line or can be packaged in an executable JAR file.
All it needs is a JDK to run.
Another great feature is in the area of clustering. A high availability fail over mechanism can be used (facilitated by
Hazelcast). When a node goes down, the verticle will automatically be deployed to another node.
Vert.x 3.0 is currently being developed and we’ve already discussed some key features. It is Java 8 only. When moving to
version 3 you have to move to Java 8. Instead of the Rhino JavaScript engine in Vert.x 2, the Nashorn JavaScript engine
will be used. Vert.x 3 also comes with a way to generate Rx-ified versions of your API, runtime metrics (exposed in JMX
and available in event bus) and distributed data grid functionality. A snapshot version of vert.x 3.0 is currently available
in maven central that you could try out.
Day 4 Internet of Things magic show
Written by Bram Patelski
By Stephen Chin
Stephen Chin talked shortly about the future of the Internet of Things.
The number of devices per person will explode in the coming years. At
this moment, the average number of devices connected to the internet
is more than 2 per person. It is expected to be more than 6 devices per
person by 2020.
The challenge for hardware is that chips need to be very small, to fit in any
object and have super-low battery usage. Devices need to be able to run
for years, without changing batteries.
Software for these devices will be mostly Java based. It is already largely
used for embedded devices. Java 8 is even more suited and aligns Java SE
and Java ME in both API and language.
The larger part of the presentation was a magic show demonstrating a Makerblock robot that was programmed to drive
over a line and a grab a ball to bring it to the end of the track. Stephen Chin also talked about 3D printing and demonstrated the Ultimaker 2.0.
Unfortunately his co-speaker was unable to attend, so some parts of the Magic show could not be demo’d.
Day 4 Everything You Wanted to Know About
Writing Async, Concurrent HTTP Apps in Java
Written by Mark Stoetzer
Yoav Landman elaborated on the efforts on implementing parallel file downloads with stop, start and resume functionality.
The UrlConnection did not facilitate enough for their requirements. While researching their options, they concluded that
they have to use the reactor design pattern (see image).
JavaOne 2014 Report
14
When saying reactor, NIO comes to mind. Because handling reactor events is complicated, they tried a couple of libaries
(they didn’t want to use a server like netty, grizzly, etc.) among which are Apache Mina, Ning Http async client and
Apache Http async client.
Ning and Apache are similar in functionality. To postpone the decision they made an abstraction layer to be able to
switch between libraries. In the end they chose the Apache library (because it has better performance).
The HTTP 1.1 spec specifies that at most 2 clients can be served in parallel and in the case of file downloads that would
result in a maximum of two parallel file parts. Initially all browsers forced this behavior, but nowadays this is not a hard
requirement for all regular browsers. Another problem they encountered in the HTTP spec is that the content-length in
combination with compression is not clear.
In the HTTP 2.0 spec the above problems have been fixed (multiplexing is used to fix the parallel issue). Next to this also
header compression and pushing to a client is covered in the new spec.
They chose to use a single part file with a range to write to for each parallel download. A java.nio.channels.FileChannel
can be used to do this (Random access is not threadsafe). When implementing parallel downloads you have to take care
of the file parts to prevent data corruption. You have to use VM file locking and OS file locking to guarantee that the data
does not become corrupt. Furthermore, when using a single file, you have to use a shared lock. Windows only allows
exclusive locks, but you can use a workaround for that.
Day 5 Transforming Business-Driven to
Technology-Driven Organizations
Written by Mark Stoetzer
Davinder Kohli and Dave Greenfield spoke about moving towards a technology driven organization. While a business
driven organization is typically based on what you already know and is also organized as such, a technology driven
organization aims for innovation and organizational focus.
To achieve organizational focus, a balance needs to be established between innovation and market expectation. When
goals are clear, an overall technical roadmap should be created and accessible by everyone involved. There should be
complete transparency in all the decisions and advancements and everyone from your business or customer that has
anything to do with your product has to be included in communication and collaboration. You should also take care
that there is direct communication between parties that collaborate and remove any organizational tiers that might
compromise this.
Last but not least, you should not stick with what you know, but be bold and strive for out of the box solutions.
Day 4 Principles of Evolutionary Architecture
Written by Mark Stoetzer
Architecture in combination with agile is my one my main interest and I therefore had to attend the “Principles of
evolutionary architecture” session by Rebecca Parsons. I expected much from this presentation and she did live up to it.
In the early days of software development, businesses typically would have 5 year plans. Nowadays, this is unthinkable.
Business lifetime is shortening and when not keeping up you will miss your window of fame.
There are two kinds of architecture in response to change:
1.Evolutionary
2.Emergent
With evolutionary architecture you have a clear goal and you think about “how do I get there”. Emergent is more ad hoc
and the notion of what is good is vague. These have similarities, but they are on a different scale.
The principles of evolutionary architecture:
• Last responsible moment
JavaOne 2014 Report
15
•
•
•
•
Architect and develop for evolvability
Postel’s law
Architect for testability
Conway’s law
Last responsible moment
Delay your decisions as long as you can. In this way, you maximize the information you have to be able to make a better
decision (not based on guesswork). This way you will minimize technical debt (any drag in your development process).
Most important is to know what your drivers are and prioritize decisions accordingly.
Architect (Design) and develop for evolvability
You have to have a sensible breakdown of the functionality considering life cycle and ownership. Ease of change is a
key factor in this. You could ask: “In what part of the system, when we change something do you get nervous?” to expose
any vulnerabilities.
Coupling is an attention point and should be appropriate. The low coupling solution is not always the best solution.
When doing agile some developers often then to skip documentation. This is not advisable. A better approach would be
to have lightweight (easy to change and maintain) tooling and documentation.
In the development process you have to focus on ease of change using software quality metrics. Using these metrics is a
continuous effort in which you have to focus on hotspots and trends.
Postel’s law
Postel’s law says to be conservative in what you send and liberal in what you receive. By being conservative in exposing contracts, you delay the actual decision of the contract. After exposing it, it will become harder to change. When a
contract must be broken use version changes.
By being liberal in what you receive, you can change the software more easily. Therefore only validate what you actually
need. Think about what the consequences are of changing your mind and act on it (for example adding extra layers).
Architect (Design) for testability
Tests help the business understand the product. Aiming towards testability produces a well-architected system. Use
technologies for their specific purpose and be careful to introduce complexities that threaten the testability. Create your
tests at many levels.
Conway’s law
Conway’s law says that organizations design systems reflecting their communication structures. Broken communication
implies complex integration. Silos often result in broken communication. If you don’t want your product to look like your
organization, change your organization.
Techniques
Certain techniques can be used to optimize evolvability like Database refactoring (break into small changes), Continuous
delivery (integrate as soon as possible, automate your environment, deployment should be boring), choreography
(decentralizing your architecture, distributes complexity), Contract testing (integration point, maximizes parallel
independent work, document assumptions)
JavaOne 2014 Report
16