“You got your Browser in my virtual mchine! Leveraging sophisticated browser programming modes in your Java applicaion”
Speaker: Ean Schuseller
For more blog posts from JavaOne, see the table of contents
He started by showing a video of the Sophia (and Einstein) robots. They look surpisingly humanoid. Not the video but this is the robot. Relevant in that we need better interfaces than have now. Future: “that was the best customer service person; very patient and immune to me getting angry”
Web Extensions
- Plugin for browser
- Needed to use C in the past
- Browser agnostic APIs
- Write in JavaScript
- Have access to browser components like history and open pages
- Works on Firefox, Chrome, Opera and Edge. Works a bit different on Edge” [not safari yet]
- Contains manifest.json, html and javascript code for UI, background js (runs when browser opens and state stays until close browser) and content js (what see)
Isomorphic Apps
- Code that can run on both client and server
- Ex: Validation logic, business logic
JavaScript in your server
Nashorn is faster in Java 9
[glad I wrote the “throwaway” chapter on Nashorn for our book. Learned a lot]
APIs
- WebWorkers –
Don’t want intensive logic in main UI thread. WebWorker runs message/task in background. - indexedDB transactional persistent data store
It takes a lot to get users to install an app because of trust. Web/online mobile “apps” continue to grow as get more powerful. Will need to have reall good reason to have an app. [irony wih the JavaOne conference app?]
Evolution in JavaScript
Frameworks, immutables reactive, functional programming, etc. Lots of ibraries. Now that more mature, Java can cherry pick from JavaScript.
Libraries
-
React – UI model from Facebook. Very data intensive programming
- Reducers – Virtual DOM is rerendered based on state change and then diffed against real DOM
- Redux – extends to single immmutable state. reducer functions “modify” state
- Helps debugging/testing because can replay actions from older state. Also helps with undo because can just go back a few states
Filter Bubble
- Cognitive bias from friends, reading, etc. Disagreeable facts never reach us
- Social networks and search enginges feed us information they think we will like. Not even concious of the bias. Disparity – they know more than you about what you see
- You trust your spam filter – it controls whether you see a message
- Filter Bubble web extension – determines where you spend time so you know too. Uses word frequency analysis
My take: Nice to see Oracle is open minded about having JavaScript content at JavaOne. There was even a bit of Java in this talk. Good first session. A mix of things that I didn’t know, things that I knew at one point and forgot. Plus some things I know. Happy to start the day with learning!