Here are my notes from the talks I attended on Day Three of OracleCodeOne. Some excellent content – feel free to engage me on twitter at @markee174 if you have any questions.
Code One Community Keynote: Game On [KEY1108]
Lots of silly costumes, weak plot linkage and Java Champions onstage.
Some Java coding in VisualCafe from the past.
Trip from the 1990s – now.
You had to be there really….
11.30 Exploring Collectors [DEV3891]
Methods added in almost every release since Java8
Java has functional programming capabilities from Java8. Venkat really likes Java implementation of functional programming with lambda
Java includes both functional composition and lazy evaluation
Common ops – filter, map, reduce
Reduce is going from stream to non-stream
Functions should be pure – no side effects (does not change anything OR depend on something which may change)
Avoid shared mutability – a nice example to show with .forEach() because of parallel. Fixed by using collect(tolist())
Can also use toSet() and toMap()
In Java10 can also create unmodifiableList
partitioningBy() demonstrated for splitting up list
Collectors have high level abstraction so code better describes the problem
groupingBy() demoed to sort Names with possible duplicates
JDK 12: Pitfalls for the Unwary [DEV3933]
Now titled JDK13: Pitfalls for the Unwary
Java9 was a very big change as last old-style major release. Also added big changes with a jigsaw, first release to see changes to clean-up technical debt
Compatibility always important
Deprecation added in 1.1 but nothing ever removed before Java9 despite 492 deprecations in Java8. Now could be removed with 1 release notice (ie months)
Module system has a big impact on migration to newer Java
75 OpenJDK modules (24 JavaSE, 2 aggregators, 1 smartcard, 48 JDK) , Oracle JDK 14 additional (ie 8 JavaFX)
Internal APIs now encapsulated (ie sun.misc.unsafe)
Explanation of classpath versus modulepath
Encapsulation can currently be ‘disabled’ or worked around (–add-exports or –add-opens)
jlink lets you build custom runtime. Use jpeds first if you want to carry on using classpath so you can avoid unused items in JDK
Someone in the audience actually using Corba
All missing modules (except Corba) on Maven Central
_ is a reserved keyword so no longer a variable name __ now allowed
addpropertyChangeListener/removePropertyChangeListener from 3 jars (Pack200, unpack200, LogManager)
jdeprscan in Java9 to spot deprecations
File structure changed so cannot rely on fixed locations
No separate JRE directory now, tool.jar or rt.jar
Version string format changed
JNLP now uses strict parsing
lib/ext and lib/endorsed directories gone. The startup will fail if directories exist
Lots of JVM flags ignored and changed (ie PrintGC now -Xlog:gc)
50 Java8 JVM flags will stop JVM running until removed
Cannot have class var (Var okay)
Deprecated things removed in Java10
javah (use javac -h) and policytool removed
Alignment of Oracle and OpenJDK meant lots of things disappeared in Java11. JavaFX no longer in core, browser plugin gone, Java Web Start (IcedTEA Web good alternative)
Lots of tools went – appletviewer, jcontrol, CORBA tools, and others
SNMP, T2K font rasterizer, Lucida, security certificates
Removed finalize() from several IO classes
javac no longer support Java6
2 APIS removed – Runtime traceInstructions() and traceMethodcalls()
Oracle JET for Complete Beginners [DEV2496]
Written to fill an actual need in Oracle. It is a free and OpenSource library using several OpenSource libraries with additions
Enterprise stack Toolkit to create Web and Mobile apps
No server – all clientside. Assumes data comes from somewhere (ie REST endpoint)
Sample JET application created. Download and install NPM and then ojet projects set of command line options to create and build Apps
ojet serve allows you to build Application inside browser from empty sample application
cookbook provides a large collection of components to use. Easy to cut and paste code which can be customised in Cookbook
Ecovue showing how they use a jet to buildOneVue invoice application
3 examples – google Oracle awesome JET
Release cycle – minor every 2 months, major every 6 months
JET can work offline
Oracle is standardising on JET for its clients
Easy Microservices in the Cloud with Kubernetes and Istio [DEV1197]
Docker gave us self contained images
Core issue managing the infrastructure. Solved by Kubernetes which automates and scales application. Also, help to manage. Makes things simple but less simple to manage
Runs on cluster mode.
Reads YAML file, applies and connects via CLI to setup
Main advantages of microservices individual development, deployment and fault isolation, granular scaling
Most issues within microservices
Demo using JHipster
Microservices gateway is the entry point
Istio makes it much easier to monitor and control the microservices with minimal latency
In control plane
Pilot discovers Mixer and finds services
Galley does the validate, process and distribute
All generated by Jhipster and part of setup with kubernetes flag
Option to enable Istio
Kotlin for Java Developers [DEV1857]
Statically typed programming language for modern multiplatform applications (works with Java and Android).
Can compile to Android, Java, Web,and native (iOS, Windows, Linux, Mac – no VM). Source is platform independent
Works on 1.6 and above
So buy a server and all clients in 1 language
Live coding Demo in Intellij – only way to learn a new language is to write in it
Functions start fun!
Intellij will suggest code improvements
A nice feature to extend classes ie fun String.hello(): will add hello method to String
You can call Java from Kotlin and Kotlin from Java
functions can have default input values
data class similar to upcoming records class in Java
String? – ? shows value can be null
Includes functional programming ( ie .filter)
suspend keyword for coroutines lets you handle async very cleanly
Sarcasm as a Service [DEV1149]
Overview of NLP and Machine learning
AI is machine learning in a Powerpoint presentation
Free machine learning tier in Azure
Shows Stanford treebank of IMDB database and how to manually score sentences for negative sentiment.
Machine learning has been in use since the 1980s.
Google auto-completion is machine learning
Changed from machine learning to deep learning by big data explosion
Microsoft recently created ml.net for machine learning
Running Yelp reviews through auto ml.
Testing with sarcastic statements on Azure
Example – “You look good when your eyes are closed but the best when my eyes are closed”
Does okay job.
Sarcasm is not irony. It is biting with intention to correct using neutral or pleasant words to deliver harsh criticism. Very hard to detect.
Deep emoji http://deepmoji.mit.edu trained on billions of tweets to try to learn sarcasm off emojis.
Demo on finish with galaxy of links – kittens next to puppies!
All Machine learning needs human guidance to correct mistakes such as AI engines deciding women are bad hires as few women it tech.
link for resources at https://aka.ms/sarcasm