4. Java 9 and Modular Programming (2)
• module = group of packages with a name
• module includes module-info.java descriptor
• prevents from internal code exposure (public ≠ accesible)
• dependency validation on VM startup, not runtime
• command line support for compiling, running, packaging and
linking modules:
– jlink command for module dependency linking
– -modulepath param for javac, java and jlink
– jar support for modules
– module path and classpath can be mixed
– jdeps for dependency check
6. HTTP/2 and Java 9 (1)
Reasons and features:
• no more domain sharding and image spriting;
• async and prioritization of frames lifting
restrictions on connections count;
• correlated resources: download all at once;
• header compression (up to 85% gain).
9. HTTP/2 and Java 9 (4)
Requirements and support:
• existing apps work as is
• TLS (SSL) for browsers
• JDK 8, Servlet 4.0 for servers
• Jetty, Tomcat to support from v.9
• HTTP/2 Client API in JDK 9
10. Other Java Enhancements
• New Collections API:
– collection literals: List.Of(…), Set.Of(…), Map.Of(..);
– immutable collections.
• Value types considered for Java 10:
– type specialisation using primitives (List<int>);
– tuples (e.g. multi-valued returns).
11. JSON API Upgrades for Java EE 8 (1)
• JsonArray using JsonArrayBuilder:
JsonTarget target = Json.createArrayBuilder()…;
JsonArrayBuilder builder = Json.createJsonArrayBuilder(target);
JsonArray result = builder.add(…).set(…).remove(…).build();
• JsonPointer for getting JsonValue at a
specific path:
JsonPointer p = new JsonPointer(“path/key”);
JsonValue v = p.getValue(json);
//p.add(…); p.replace(…); p.remove(…);
12. JSON API Upgrades for Java EE 8 (2)
• JsonPatch for document modifications:
– allows changes to be applied in bulk;
– can provide diffs between two docs.:
JsonArray diff = JsonPatch().diff(doc1, doc2);
• Json Queries:
– can filter out into JsonObject or JsonArray;
– supports groupBy and queryAndPatch
(filter and update) operations.
13. Spring Roadmap
• Spring 4.3 to show up in Q2/2016
• more annotations for DI and HTTP binding
(@RestController, @Get/@Post, @SessionScope)
• last version to be supported by Java 6/7
• Spring 5 to be released in Q4/2016
• JDK 8+, including Java 9
• will support HTTP/2
14. Understanding Git Internals (1)
Git’s data structure:
commit > tree > blob(s)
• Commit – results in a new tree, points to its parent
commit (backwards)
• Tree – points to blobs and other trees, is a snapshot of
a single commit
• Blob – points to objects. Any change to file
results in a new blob
16. Understanding Git Internals (3)
ref – pointer to an object
branch – commit with two childs
merge – child with two parents
tag – not-updated ref with a name
reset – tag manipulation moving pointer back in the tree
See git reflog
17. Principles of Microservices (1)
Microservices –
small autonomous
services that work
together and are
modelled around a
business domain
19. Principles of Microservices (3)
• Model Around a Business Domain – more stable APIs
• Culture of Automation – much more to deploy
• Hide Implementation Details – every service should evolve
independently
• Decentralize – self-service oriented, creates autonomy
• Deploy Independently – deploy changes without changing everything
else
• Customer First – thinking outside-in, not inside-out; users should drive
the API
• Isolate Failure – fail fast; improved resilience
• Highly Observable – a lot of interaction and logging is going on
22. Best Practices for Java Deployment (3)
Codebase – use version control (duh); 1 repo for 1 app
Dependencies – explicitly declared and isolated; no jars in SC
Configs – changes between deployment envs.; part of envrmnt., not app
Backing services – should be attachable via single URL
Build, Release, Run – three discrete steps should be present
Processes – should be stateless and fail-safe
Concurrency – workload diversity; scale out, kind of microservices approach
Disposable – quick to start-up, graceful to shut down, resilient to failure
Dev/Prod Parity – keep dev. environment as similar to prod as possible
23. Vizualizing Architecture
When visualizing:
• use different abstraction levels for
different levels of information details;
• imagine code as a map – zoom into it as
much as necessary to see the required i
mage.
24. Top Talks
1. Get a Taste of Lambdas and Get Addicted to Streams
2. The Silver Bullet Syndrome
3. Design Patterns in the Light of Lambda Expressions
4. Core Design Principles for Software Developers
5. Hand's on Web Components with Polymer 1.0
6. Java pub quiz (BoF)
7. Getting started with Spring Cloud
8. Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap
9. From Junior to professional in 20 * 15000ms
10. Hands on Ratpack