Hi All,

This email's purpose is a request for comments to migrate Arrow Java to JPMS
Java Platform Module System <https://openjdk.java.net/projects/jigsaw/spec/>
JSE 9+ (1).

Current status:

- Arrow Java use JSE1.8 specification

- Arrow Java works with JSE1.8/9/11/17

- This is possible because Java offers “legacy mode”

Proposal:

Migrate to JPMS Java Platform Module System. This Draft PR
<https://github.com/apache/arrow/pull/13072>(2) contains an initial port of
the modules: Format / Memory Core / Memory Netty / Memory Unsafe / Vector
for evaluation.

Main Reason to migrate:

- JPMS offer Strong encapsulation, Well-defined interfaces
<https://github.com/nipafx/demo-jigsaw-reflection>, Explicit dependencies.
<https://nipafx.dev/java-modules-reflection-vs-encapsulation/> (3)(4)

- JPMS offer reliable configuration and security to hide platform internals.

- JPMS offers a partial solution to solve problems about read (80%) /write
(20%) code.

- JPMS offer optimization for readability about read/write ratio (90/10)
thru module-info.java.

- Consistency logs, JPMS implement consistency logs to really use that to
solve the current problem.

- Be able to customize JRE needed with only modules needed (not
java.desktop for example and others) thru JLink.

- Modules have also been implemented by other languages such as Javascript
(ES2015), C++(C++20), Net (Nuget/NetCore)..

- Consider taking a look at this discussion about pros/cons
<https://www.reddit.com/r/java/comments/okt3j3/do_you_use_jigsaw_modules_in_your_java_projects/>
(5).

- Eventual migration to JPMS is a practical necessity as more projects
migrate.

Effort:

- First of all we need to decide to move from JSE1.8 to JSE9+ or be able to
offer support for both jar components JSE1.8 and JSE9+ included.

- Go bottom up for JPMS.

- Packages need to be unique (i.e. org.apache.arrow.memory /
io.netty.buffer). Review Draft PR with initial proposal.

- Dependencies also need to be modularized. If some of our current
dependencies are not able to be used as a module this will be a blocker for
our modules (we could patch that but this is an extra effort).

Killers:

- FIXME! I need your support to identify killer reasons to be able to push
this implementation.

Please let us know if Arrow Java to JPMS Java Platform Module System is
needed and should be implemented.

Please use this file for any comments
https://docs.google.com/document/d/1qcJ8LPm33UICuGjRnsGBcm8dLI08MyiL8BO5JVzTutA/edit?usp=sharing

Resources used:

(1): https://openjdk.java.net/projects/jigsaw/spec/

(2): https://github.com/apache/arrow/pull/13072

(3): https://nipafx.dev/java-modules-reflection-vs-encapsulation/

(4): https://github.com/nipafx/demo-jigsaw-reflection

(5):
https://www.reddit.com/r/java/comments/okt3j3/do_you_use_jigsaw_modules_in_your_java_projects/

Best regards,

-- 
David

Reply via email to