Protokoll der Teilnahme an der Studiensitzung.
Java 9
| Java 9 Features | |
|---|---|
| Module System | jigsaw,Geeignet für die Cloud-Bereitstellung, Docker, module-info.In Java definiert |
| The Modular JDK | |
| jShell | |
| Encapsulate Internal APIs | |
| jlink | Werkzeug, Linker can produce custom runtime image(Regular, JVM specific memory images, fast exec) |
| Ahead of Time (AOT) Compilation | statically compile java classes,Statische und dynamische Kompilierungsintegration |
| G1 Garbage Collector as the Default | Teilen Sie den Heap-Bereich in feste Größen, E, S,Mark O. |
Modularisierungsmethode
module com.foo.bar{
require com.foo.bar
exports com.foo.bar
}
Modular Development
| In jeder Schicht ist eine Modularisierung möglich |
|---|
| Modular Application |
| Modular Link |
| Modular JDK |
| Accessibility | Java 9 Barrierefreiheit |
|---|---|
| public | public to everyone |
| public but only ... | |
| public only within a module | |
| protected | protected |
| private | private |
src/module-info.java
module hello.world{
exportiert com.example.hello; // Extern veröffentlichte Pakete requires java.base; }
| hello.world |
|---|
| com.example.Hallo Öffentlichkeit |
| (No concealed packages)versteckt |
Migrating from the top down
Bibliotheksabhängigkeiten von Drittanbietern -> Abhängigkeiten mit dem Befehl jdeps extrahieren
Automatic Modules Automatische Modularisierung (wenn Sie eine Drittanbieter-Bibliothek für die Modularisierung verwenden möchten) Der JAR-Dateiname ist der Modulname Alles veröffentlichen
module hello.world{
exports com.example.hello to myapp;
erfordert java.base; // standardmäßig hinzugefügt requires jackson-core; öffnet com.myapp.domain für jackson.databind // Verhalten nur bei Verwendung von Reflection
uses javax.print.PrintServiceLookup
}
module printlib{
provides javax.print.PrintServiceLookup with groovy.backend.CodeEvaluatetionEngineFactory;
}
JDK layout assumptions Wechseln Sie das Verzeichnis rt.jar
Class loader assumptions Klassenladereihenfolge
System property changes
Referenzmaterial JEP 261
Zirkuläre Abhängigkeiten von Modulen vermeiden
httpClient.java (abhängig von logging.api) | > loging.apis interface LogSPI < | logging.impl (abhängig von logging.api) class HTTPLogger implements LogSPI
| Java Future | Die Zukunft von Java |
|---|---|
| uniform model | object, Array, value, types, methods |
| post-threaded | Confined/immutable data |
| Data Layout | Codes like a class, works like an int! |
Data Layout
class Point {
final int x;
final int y;
}
Point[] pts = |x|y|x|y|x|y|Ich möchte ein Bild von machen
jetzt,|x|y| |x|y| |x|y|Bild mit einer Lücke wie Weniger effizient mit GC
Java EE 8
| Java EE 8 | |
|---|---|
| JAX-RX2.1 | |
| Servlet 4.0 | HTTP/2 performance, server push |
| JSON-B 1.0 | JSON <-> Java binding |
| JSON-P 1.1 | |
| CDI 2.0 | |
| Bean Validation | |
| JSF 2.3 | |
| Security 1.0 |
Deep Learning
deepleaning4j
Recommended Posts