James Gough

Distinguished Engineer, Java Champion, Speaker and Author
JDConf Day 1: Notes and Thoughts

27 Oct 2020

Whilst watching the sessions today at #JDConf I’ve created a few notes/summary of my thoughts. Apologies I didn’t get to cover every session, I listened in to most sessions and thought they were amazing. I had dinner with the kids and had to do a few other things going on during the sessions (as is the current way)! I will aim to come back to this page and add links to the videos once they are available.

Modern Java: Beyond Version 8 - @techgirl1908

Developers love to complain about Java syntax, but are there modern things that you might have missed?

Var
AccountsOverviewPage accOverviewPage = page.login(username, password);
//Can now be 
var accOverviewPage = page.login(username, password);

Can only be used as local variables, not as method types or global variables. When using var naming is even more important than ever, don’t overdo it :).

Functional Programming Style for Testing

Although functional programming “style” has been used in production code from Java 8 there is not as much adoption for tests. takeWhile(predicate) is new in Java 9, allows iteration to occur until a matching condition matches. dropWhile(predicate) drops items from the stream until the predicate matches. takeWhile and dropWhile are useful actions to occur on sorted streams.

Switch Statements -> Switch Expressions

break are risky and can be re-written as:

String id = switch(name) {
  case "john" -> "12212";
  case "mary" -> "484747";
}

It is also possible to combine values, use block syntax. Use expressions when you are using switch to assign value.

Records

Useful for objects that are used to represent state without modifying behaviour. Accessor methods do not start with getId() Records are a preview feature, to allow developers to provide feedback.

public record Account {
   int id;
}
Summary

Small changes in the language are starting to improve the readability and usability of the language. More frequent releases of Java and having preview features allows for more changes to be added to the language. I wonder if Venkat will have similar features in his talk tomorrow.

Super Charge Your Spring Boot Apps - @rorypreddy

Spring Boot accounts for 50% of Java Application frameworks within the Java ecosystem, with Spring MVC not far behind. The environment provided for Azure Spring Cloud is insane. In this talk @rorypreddy demonstrates different parts of the Ecosystem, including how to monitor and scale your applications.

There’s so much useful content in this talk it’s worth watching it back. I was planning on having a go with this at the weekend, but the developer tier is quite high priced. I hope there is a cut down environment planned for developers to get hands on with tooling.

Java and VSCode: Tips and Tricks - @loiane

A really useful guide to getting started with VSCode, it is crazy how much support has been added to VSCode!

The Hacker’s Guide to JWT Security - @yonlabs

Use a JWT token and it will be secure, they said…

This talk was a great exploration into the weak links in security when using JWT. The demos are worth watching if you do anything with REST APIs. I am always a fan of talks that demonstrate live exploits with the attendees.

Accessibility in the Time of COVID-19 @accessaces

The final talk of the day was one of those talks that really gets you thinking about design and technology and making solutions available to all. Even really simple things like a COVID alert level as an image, without alt text will not work with screen readers. The talk was also auto-captioned and although not perfect was interesting to see that in use.

Tomorrow

I’m really looking forward to tomorrow’s talks. My plans will be to create notes like this and to live blog the keynotes.