post-thumb

Buzzwords I followed at JavaOne 2017

Colleagues of mine already wrote on JavaOne in this very Blog. They covered large and very interesting subjects regarding… Java! But also microservices and all. Here are their posts:

So I have no other choice than to take another angle to give my feedback on this conference: they did a great job and I have nothing to add to what they wrote.

My angle is buzzwords. Yes, like Alice in Wonderland I decided to follow some buzzwords just to see where I land.

These buzzwords are: Artificial Intelligence (AI), bots and JavaScript (yes I know at JavaOne…).

AI is in the AIr

Oracle CEO, Larry Ellison, announced AI in Oracle database. But that was at the OpenWorld event, located next to JavaOne. And this is not what interested me.

But this illustrates how AI was everywhere in the Moscone center at that time.

They were many talks about AI, I attended a very interesting one called Intoduction to ML with Apache Spark MLlib .

There are many open source frameworks out there to implement Machine Learning, most of them are not in Java. That’s why I was interested in Spark MLlib.

The speaker, Taras Matyashovsky, gave a good insight on what are Supervised learning, Unsupervised learning and Reinforcement learning.

No need to go into details here, just remember it is all about math and not magic. Here are two of his slides that categorize and list some of commonly used algorithms.

{: .center} Supervised learning algorithms

{: .center} Unsupervised learning algorithms

And Spark MLlib is a Java library of such machine learning algorithms and other utilities. It is designed to run in parallel on Spark clusters, so it inherits the scalability and deployability of the Hadoop ecosystem. One nice feature is model selection where MLLib uses data to find the best model or parameters for a given task.

Taras finished by a live demo on how to build a ML pipeline to determine if some given lyrics are those of metal or pop songs. Quite impressive.

Here is an illustration of his ML pipeline.

{: .center} Pop/Metal pipeline

His demo is available on GitHub .

My conclusion is that even if ML is a complex thing with a lot of math inside, existing frameworks and libraries make it easy to implement. Even in Java.

They were many other talks about AI and ML, this one is particularly enligthning: Machine Learning for Java Developers in 45 Minutes by Zoran Severac and Frank Greco.

Bot is the new black

And nowadays when you hear or speak about AI, the term bot is often not very far away. Actually the buzzword is more chatbot.

The funny thing about the two talks I attended to about chatbots is that they were both from big players. Amazon and IBM in that case. Of course both showed me chatbots (build one with Amazon, see one in action with IBM), and they both had either theoritical aspects nor returns on experience.

The Amazon one gave pretty much information on vocabulary and architecture. Basically, chatbots are a lot about Automated Speech Regognition (ASR) and Natural Language Understanding (NLU). These are where you find the AI (and big players platforms). Today these technologies are very mature, we speak about Voice User Interface. I even heard: The new UX is no UX.

In this field, concepts and vocabulary are quite standardized with terms like Intent (the goal of the user), Utterances (phrases to invoke this intent), Slots (words with intent), Prompts (questions asked to the user), Fullfillment (business logic to fullfill intents). This indicates that this part of chatbot is mature and well covered.

Finally Voice UI/UX is just another channel to be integrated in a global architecture that links users to some business logic. This is quite well illustrated by the following schema extracted from the Amazon presentation by Arun Gupta.

{: .center} Chatbot components (Amazon vision)

IBM talk by Holly Cummins was funny because the talk itself was the demo. Meaning a bot was showing the slides and answering questions.

{: .center} Chatbot in action

The talk was a lot about feedback, do and don’t when designing and implementing a chatbot. Here are some of (my) few picks, finally they all concern the end-user:

  • explain limitations of the chatbot
  • when the chatbot doesn’t know the answer to a question it is recommended to say so (I don’t know) and then hand off to a human
  • provide buttons in your UI to prevent users from using their keyboards too often
  • detect frustation or loops in the discussion and hand off to a human (via for instance a circuit breaker mechanism)
  • should really your chatbot appear as human?

But as stated earlier, once the chatbot is integrated in your solution, with your backends… it’s DevOps as usual. You have to test it first and a lot, it has to be source controlled, built, deployed, monitored, etc.

And again, architecture is key (I think you have now an idea of what my everyday job is…).

{: .center} Chatbot architecture (IBM example)

To conclude, bots are nice and trendy but, at the end of the day, they are new components and technologies to integrate with wisdom in our information systems.

Java(Script)?!

Not really a buzzword you would say… Well it was for me in the JavaOne context. How come they are talks about JavaScript in this particular event?

To cut it short: no talks about TypeScript or Node.js ;) it was more about how to manipulate or execute JavaScript in the Java way.

SAP (a big player again…) within the Eclipse Dirigible project is establishing a set of what they call Enterprise JavaScript API which could be used in a standardized way for business applications, using for instance CommonJS modularization. It supports several JS engines like Nashorn, Rhino and V8 (soon).

And clearly the way these API are designed comes from Java. For instance the API for HTTP is similar to the Servlet API, the one for databases is similar to JDBC. They also have file operations, WebSocket, messaging, SOAP, and even stream manipulations and threads (yes, yes you read well).

{: .center} Enterprise JavaScript (Dirigible)

Their goals are to be complete and portable, like Java. No vendor-locking on JS engine, portability on different OS, databases and runtimes.

I have to admit, I was a little bit dizzy at the end of the talk of Vladimir Pavlov and Nedelcho Delchev.

The other talk regarding JavaScript was named Compiling Java to Javascript - How to Replace Applets Without the Plugin . The subtitle definitly got my attention and I’m sure most of you still have applets somewhere like a thorn in your side.

The talk was a feedback on such an issue, by Davin McCall and Michael Kölling from King’s College in London: they used a Java-to-Javascript transpiler to convert code from one to another.

To do this they choose TeaVM which actually translate bytecode (so Java but also Kotlin and Scala) to JavaScript. This implies that source code is not required. This is one difference with GWT. Another one is thread support. In fact, just like Dirigible, TeaVM implements basic Java API.

Another interesting feature is the capacity to implement native JS methods in Java through annotations.

@JSBody( params = { "array", "mediaType" },
script = "var blob = new Blob([array], {type: mediaType}); return URL.createObjectURL(blob);" )
private static native String toBlobUrl(Uint8Array array, String mediaType);

The feedback was: it works, not all the time. In their case, they seem quite happy of the result regarding the size of their existing codebase. Here is an example of tranpilation.

{: .center} TeaVM transpiler

Don’t try to read the code, this snapshot is here just for you to visualize transpilation.

Finally regarding JavaScript, because it is here and might not disappear right away (it even came on server-side), Java developpers are looking for ways to deal with it. Enterprise JavaScript from Dirigible and TeaVM are two different approaches.

But heck! Implementing threads and Java-like API? Time will tell…

Wrap up

This is it. Not too boring I hope.

There were many buzzwords in JavaOne 2017 as we all could expect. I wrote here about some of those I followed between talks on Java 9, modules and EE4J. JavaOne is like a Jigsaw at the end, everything fit in a way ;) It’s not already Wonderland for all of them but is was still interesting to go down the Rabbit-Hole.

Oh! One last cookie before leaving you: DevOps. Ah… that’s a buzzword!

Of course they were many talks on the subject but I really really liked the one from Patrick Debois (the guy who coined the term DevOps). Here is the video . Basically he stated that in the era of API and serverless, DevOps pratices have to evolve to stay true to DevOps pinciples. Food for thought isn’t it?