Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Java 9: Jigsaw Project

445 views

Published on

This presentation, inspired by the Lord of the Rings trilogy, depicts one of the most anticipated features of the JDK 9: Project Jigsaw.
It covers the following topics: Architecture; Accessibility; Modularisation; Implied Readability; Restricted Readability; Fat JARs; and Java Images.

Al the source code, inclusive a extensive documentation, can be found here: https://github.com/ekholabs/postcode-modules

Published in: Software
  • Login to see the comments

  • Be the first to like this

Java 9: Jigsaw Project

  1. 1. THERE AND BACK AGAIN, A TALE ABOUT…
  2. 2. JIGSAW TOPICS ▸ Architecture ▸ Accessibility ▸ Modularisation ▸ Implied Readability ▸ Restricted Readability ▸ Fat JARs ▸ Java Images
  3. 3. JIGSAW WILDER RODRIGUES ▸ Crazy about Java, AI & ML; ▸ X-Men geek; ▸ IBM Watson AI XPrize contestant; ▸ Guest attendee at the AI for Good Summit, United Nations; ▸ Proud to be a family man and father of 3. @WILDERRODRIGUES
  4. 4. JIGSAW ARCHITECTURE ▸ Aragorn: The Beacons of Minas Tirith! The Beacons are lit! Gondor calls for aid. ▸ Theoden: And Rohan will answer. Muster the Rohirrim. Assemble the army at Dunharrow. As many men as can be found. You have two days. On the third, we ride for Gondor and war. ▸ The Lord of the Rings: The Return of the King.
  5. 5. JIGSAW ARCHITECTURE ▸ A module definition file, named as module-info.java, contains: ▸ Its name; ▸ The packages it makes available publicly; ▸ The modules it depends on; ▸ Any services it consumes; and ▸ Any implementation for the service it provides.
  6. 6. JIGSAW ARCHITECTURE ▸ ModuleDeclaration: ▸ {Annotation} [open] module Identifier {. Identifier} ▸ { {ModuleDirective} }
  7. 7. JIGSAW ARCHITECTURE ▸ ModuleDirective: ▸ requires {RequiresModifier} ModuleName; ▸ exports PackageName [to ModuleName {, ModuleName}] ; ▸ opens PackageName [to ModuleName {, ModuleName}] ; ▸ uses TypeName ;
 provides TypeName with TypeName {, TypeName} ; ▸ RequiresModifier: (one of) ▸ transitive; ▸ static; ▸ public.
  8. 8. JIGSAW ACCESSIBILITY ▸ The way is shut. It was made by those who are Dead. And the Dead keep it. The way is shut. ▸ The Lord of the Rings: The Two Towers.
  9. 9. JIGSAW ACCESSIBILITY ▸ An exported packaged is publicly available to any module, except when the exporting module declares to which that package is exported to. ▸ Packages can be transitive, meaning that if module B requires transitive module A and module C requires transitive module B, then C also contains A.
  10. 10. JIGSAW MODULARISATION ▸ One ring to rule them all, one ring to find them, One ring to bring them all and in the darkness bind them. ▸ The Lord o the Rings: The Fellowship of the Ring.
  11. 11. JIGSAW IMPLIED READABILITY ▸ Speak, friend, and enter. ▸ Written at the Doors of Durin, Moria. ▸ The Lord of the Rings: The Fellowship of the Ring.
  12. 12. JIGSAW IMPLIED READABILITY
  13. 13. JIGSAW RESTRICTED READABILITY ▸ I am a servant of the Secret Fire, wielder of the flame of Anor. You cannot pass. The dark fire will not avail you, flame of Udûn. Go back to the Shadow! You shall not pass! ▸ The Lord of the Rings: The Fellowship of the Ring.
  14. 14. TEXT RESTRICTED READABILITY
  15. 15. JIGSAW FAT JARS ▸ That still only counts as one! ▸ Gimli says to Legolas during the Battle of the Pelennor Fields. ▸ The Lord of the Rings: The Return of the King.
  16. 16. JIGSAW FAT JARS ▸ Use automatic-modules as dependencies by adding them to the module path: ▸ javac —module-path jars … ▸ Find out what the JAR dependencies through the jdeps tool: ▸ jdeps --generate-module-info . jars/gson-2.8.1.jar
  17. 17. JIGSAW JAVA IMAGES ▸ In place of a Dark Lord, you would have a queen! Not dark, but beautiful and terrible as the dawn! Treacherous as the sea! Stronger than the foundations of the earth! All shall love me, and despair! ▸ Galadriel says when offered to keep the One Ring. ▸ The Lord of the Rings: The Fellowship of the Ring.
  18. 18. JIGSAW JAVA IMAGES ▸ The Linker ▸ jlink is the linker tool and can be used to link a set of modules, along with their transitive dependences, to create a custom modular run-time image.
  19. 19. JIGSAW REFERENCES & SOURCE CODE ▸ Java Language Specification: Java SE 9 ▸ https://www.jcp.org/en/jsr/detail?id=376 ▸ http://openjdk.java.net/projects/jigsaw/spec/sotms/ ▸ https://github.com/ekholabs/postcode-modules

×