Java 9 introduces modules to the Java programming language and its runtime. Despite this feature being optional, due to the modularization of the standard library existing applications might behave differently when running on a version 9 JVM. Furthermore, because of changes in the runtime, existing libraries and frameworks might not yet correctly process your modularized code. As a result, updating to a Java 9 VM and taking Java 9 into brings its challanges.
This talk discusses the practical implications of module boundaries and analyzes new limitations Java 9 imposes on the reflection API. This talk explains how reflection is used in popular frameworks like Spring and Hibernate and explains why existing applications might break or change their behavior when facing modularized code. Finally, this talk showcases alternatives to now failing Java programming patterns and weights their robustness with regard to the Java releases 10 and upward.
The presenter is an active contributor to open source and helped to migrate many popular Java libraries to supporting Java 9. As a consequence, he as been working with Java 9 for almost two years.
An overview how to realize code generation of languages on the JVM that implement other class layouts than the Java programming languages. As an example, the inline-mock-maker for Mockito is discussed which supports languages like Kotlin that make any property final by default.
Making Java more dynamic: runtime code generation for the JVMRafael Winterhalter
While Java’s strict type system is a great help for avoiding programming errors, it also takes away some of the flexibility that developers appreciate when using dynamic languages. By using runtime code generation, it is possible to bring some of this flexibility back to the Java virtual machine. For this reason, runtime code generation is widely used by many state-of-the-art Java frameworks for implementing POJO-centric APIs but it also opens the door to assembling more modular applications. This presentation offers an introduction to the complex of runtime code generation and its use on the Java platform. Furthermore, it discusses the up- and downsides of several code generation libraries such as ASM, Javassist, cglib and Byte Buddy.
With its ninth version, the Java platform has shifted gear and introduced biyearly releases. This was followed by a license change where Oracle, the steward of Java, now publishes a commercial and a non-commercial release of the Java virtual machine while other vendors took more space to promote their alternative builds of the OpenJDK. And in another flood of news, the Java EE specification was terminated and resolved into the Jakarta EE namespace.
A lot has been happening in the traditionally conservative Java ecosystem, to say the least, and many users are wondering if they still can rely on the platform. This talk gives an overview of the Java ecosystem, summarizes the changes that have been, that to expect and why the evolution of the platform is good news to the community.
An overview how to realize code generation of languages on the JVM that implement other class layouts than the Java programming languages. As an example, the inline-mock-maker for Mockito is discussed which supports languages like Kotlin that make any property final by default.
Making Java more dynamic: runtime code generation for the JVMRafael Winterhalter
While Java’s strict type system is a great help for avoiding programming errors, it also takes away some of the flexibility that developers appreciate when using dynamic languages. By using runtime code generation, it is possible to bring some of this flexibility back to the Java virtual machine. For this reason, runtime code generation is widely used by many state-of-the-art Java frameworks for implementing POJO-centric APIs but it also opens the door to assembling more modular applications. This presentation offers an introduction to the complex of runtime code generation and its use on the Java platform. Furthermore, it discusses the up- and downsides of several code generation libraries such as ASM, Javassist, cglib and Byte Buddy.
With its ninth version, the Java platform has shifted gear and introduced biyearly releases. This was followed by a license change where Oracle, the steward of Java, now publishes a commercial and a non-commercial release of the Java virtual machine while other vendors took more space to promote their alternative builds of the OpenJDK. And in another flood of news, the Java EE specification was terminated and resolved into the Jakarta EE namespace.
A lot has been happening in the traditionally conservative Java ecosystem, to say the least, and many users are wondering if they still can rely on the platform. This talk gives an overview of the Java ecosystem, summarizes the changes that have been, that to expect and why the evolution of the platform is good news to the community.
micro(-service) components. While this approach to building software - if done correctly - can improve a system's maintainability and scalability, distributed applications also introduce challanges for operations. Where monolithic applications typically offered direct access to extensive monitoring dashbords, such easy overview is no longer available when multitude services are loosly connected over a network. But how to keep track of a system of such dynamic state?
Distributed tracing is a method of connecting interaction of different services on a network. Collecting and processing such tracing information again allows for the observation of a distributed system in its entirety. This talk shares the presenter's insights gained by working on the JVM-support of distributed tracing for the APM tool Instana. Doing so, it introduces the landscape of distributed tracing on the JVM, discussing popular approaches such as Dapper, Zipkin or Brave/OpenTracing. In the process, it is discussed how byte code instrumentation can be used to capture systems without requiring a user to set up the software under observation. The presentation finishes with a discussion of typical problems of distributed tracing solutions and carefully examines the performance penalties APM tools entail.
Presented at BJUG, 6/12/2012 by Roger Brinkley
This talk is on 55 new features in Java 7 you (probably) didn't hear about in an ignite format of one per minute. No stopping, no going back....Questions, sure but only if time remains (otherwise save for later).
어느덧 스무살이 된 자바. 좋든싫든 프로그래밍의 세계에 몸담고 있는 이상 부딪히지 않을 수 없는 언어인데요, 이 자바에 대한 올바른 모습의 이해화 앞으로 나아가야 할 방향을 모색해본다는 의미에서 "모던 자바의 역습"이라는 타이틀로 실시한 온라인 세미나의 슬라이드 자료입니다.
진행자: 김대우(http://lekdw.blogspot.kr/)
정도현(http://moreagile.net)
이번 세미나는 게임개발자이신 김대우님을 모시고 진행하게 되었는데요 자바 언어와 관련 하여 다음과 같은 주제로 두시간에 걸쳐 발표를 진행합니다.
- 간단히 살펴보는 자바20년의 발자취
- 자바를 둘러싼 진실 혹은 거짓(성능,생산성,품질)
- SI영역 이외에서 자바의 가치
- 모던자바의 역습: 자바8과 함수형 프로그래밍
- 자바 개발의 새로운 패러다임들
Whats New in Java 5, 6, & 7 (Webinar Presentation - June 2013)DevelopIntelligence
Kelby Zorgdrager from DevelopIntelligence explains the differences between the variations of Java and what's new in Java 7.
If you need help with Java training DevelopIntelligence and provide on-site training within two weeks. Customized and affordable for any organization.
micro(-service) components. While this approach to building software - if done correctly - can improve a system's maintainability and scalability, distributed applications also introduce challanges for operations. Where monolithic applications typically offered direct access to extensive monitoring dashbords, such easy overview is no longer available when multitude services are loosly connected over a network. But how to keep track of a system of such dynamic state?
Distributed tracing is a method of connecting interaction of different services on a network. Collecting and processing such tracing information again allows for the observation of a distributed system in its entirety. This talk shares the presenter's insights gained by working on the JVM-support of distributed tracing for the APM tool Instana. Doing so, it introduces the landscape of distributed tracing on the JVM, discussing popular approaches such as Dapper, Zipkin or Brave/OpenTracing. In the process, it is discussed how byte code instrumentation can be used to capture systems without requiring a user to set up the software under observation. The presentation finishes with a discussion of typical problems of distributed tracing solutions and carefully examines the performance penalties APM tools entail.
Presented at BJUG, 6/12/2012 by Roger Brinkley
This talk is on 55 new features in Java 7 you (probably) didn't hear about in an ignite format of one per minute. No stopping, no going back....Questions, sure but only if time remains (otherwise save for later).
어느덧 스무살이 된 자바. 좋든싫든 프로그래밍의 세계에 몸담고 있는 이상 부딪히지 않을 수 없는 언어인데요, 이 자바에 대한 올바른 모습의 이해화 앞으로 나아가야 할 방향을 모색해본다는 의미에서 "모던 자바의 역습"이라는 타이틀로 실시한 온라인 세미나의 슬라이드 자료입니다.
진행자: 김대우(http://lekdw.blogspot.kr/)
정도현(http://moreagile.net)
이번 세미나는 게임개발자이신 김대우님을 모시고 진행하게 되었는데요 자바 언어와 관련 하여 다음과 같은 주제로 두시간에 걸쳐 발표를 진행합니다.
- 간단히 살펴보는 자바20년의 발자취
- 자바를 둘러싼 진실 혹은 거짓(성능,생산성,품질)
- SI영역 이외에서 자바의 가치
- 모던자바의 역습: 자바8과 함수형 프로그래밍
- 자바 개발의 새로운 패러다임들
Whats New in Java 5, 6, & 7 (Webinar Presentation - June 2013)DevelopIntelligence
Kelby Zorgdrager from DevelopIntelligence explains the differences between the variations of Java and what's new in Java 7.
If you need help with Java training DevelopIntelligence and provide on-site training within two weeks. Customized and affordable for any organization.
The presentation slides used during WSO2Con 2011 tutorial session. The tutorial included hands on sessions as well. The slides named as 'demo' refers to hadns-on sessions/demos.
ElsassJUG - Le classpath n'est pas mort...Alexis Hassler
En 2009, la mort du classpath a été annoncée. Les classloaders à plat ou hiérarchiques devaient être remplacés par des systèmes modulaires et tous nos problèmes de dépendance devaient se résoudre d’eux-mêmes. Cinq ans plus tard, le classpath vit toujours et pour quelques temps encore.
Dans la première partie de cette session, je vous propose de revenir sur le fonctionnement des classloaders du JDK et les problèmes infernaux posés par le classpath. Nous verrons aussi comment les serveurs d’applications, comme Tomcat, gèrent leur classloaders de façon hiérarchique, afin d’isoler les applications entre elles.
Dans la deuxième partie, je parlerai de modularité et de son impact sur la gestion des dépendances, à l’exécution des applications. Des solutions existent déjà, comme OSGi, d’autres émergent, comme JBoss Modules. Je vous montrerai comment ce dernier fonctionne, dans WildFly ou en autonome.
As your app code gets larger and more complex, it makes sense to break your project out into smaller reusable components. But what’s the best way to do this? How can you clearly version your internal libraries? What kind of setup and maintenance can you expect? How much could it slow down development time?
In this talk we’ll dive into the various ways you can manage internal library dependencies. We’ll chat about the current state of Android dependency management, Gradle multi-project builds, Git submodules, and creating a private maven repository in Artifactory. The speaker will share real-world examples, and the pros and cons of each approach.
With Java 9 modules coming to us soon, you want your existing code to be fully ready for the module system. Making code modular can be a daunting task, but Java 9 comes with a number features to ease migration. This includes automatic modules, the unnamed module and a number of command line arguments.
In this talk we will look at examples of migrating real code. It discusses common problems youll run into during migration, leading to practical tips and the ability to set realistic goals. Its also a good way to understand the module system itself and the various migration paths it supports. This talk is an excellent preparation to start migrating your own code.
* Understanding modules and the module path
* Automatic modules
* Mixing classpath and modulepath
* Dealing with reflection
* Escape switches
* Jdeps
All topics will be based on examples of often used libraries and frameworks.
Facelets is a powerful templating language built from ground up for JSF.
Facelets allow for greater code reuse than JSPs. This tutorial provides an
example of how to work with JSF, Facelets and Spring-JSF along with
Maven-2 in Eclipse.
FASTEN presentation at SFScon, November 2020Fasten Project
This presentation was given by Paolo Boldi, Milano University, online.
Abstract:The goal of the EU project FASTEN is being able to perform a more sophisticated analysis of security-vulnerability propagation, licensing compliance, and dependency risk profiles (among others) by relying on the call-level dependency network of the whole software ecosystem. We outline the purpose and structure of the project, and present some preliminary results.
Java 9: Deep Dive into Modularity and Dealing with Migration IssuesGlobalLogic Ukraine
The speaker gave an overview of Project Jigsaw, explained benefits of modularity, told about module-info.java contents, dwelt upon potential migration issues and suggested their resolution; also, he revealed to the audience how to reduce the deployment size by using jlink.
This presentation by Oleh Krupenia (Senior Software Engineer, Consultant at GlobalLogic) was delivered at GlobalLogic Kharkiv Java Conference 2018 on June 10, 2018.
Similar to Getting started with Java 9 modules (20)
Java agents and their instrumentation API offer developers the most powerful toolset to interact with a Java application. Using this API, it becomes possible to alter the code of running applications, for example to add monitoring or to inject security checks as it is done by many enterprise products for the Java ecosystem.
In this session, developers will learn how to program Java agents of their own that make use of the instrumentation API. Doing so, developers learn how the majority of tooling for the JVM is implemented and will learn about Byte Buddy, a high level code generation library that does not require any knowledge of Java byte code that is normally required for writing agents. In the process, developers will see how Java classes can be used as templates for implementing highly performant code changes that avoid the boilerplate of alternative solutions such as AspectJ or Javassist while still performing better than agents implemented in low-level libraries such as ASM.
A presentation on how microservices were implemented at the Norwegian tax authority. This presentation displays concepts and shows a few implementation details of a solution for the JVM.
At first glance, writing concurrent programs in Java seems like a straight-forward task. But the devil is in the detail. Fortunately, these details are strictly regulated by the Java memory model which, roughly speaking, decides what values a program can observe for a field at any given time. Without respecting the memory model, a Java program might behave erratic and yield bugs that only occure on some hardware platforms. This presentation summarizes the guarantees that are given by Java's memory model and teaches how to properly use volatile and final fields or synchronized code blocks. Instead of discussing the model in terms of memory model formalisms, this presentation builds on easy-to follow Java code examples.
Writing software for a virtual machine enables developers to forget about machine code assembly, interrupts, and processor caches. This makes Java a convenient language, but all too many developers see the JVM as a black box and are often unsure of how to optimize their code for performance. This unfortunately adds credence to the myth that Java is always outperformed by native languages. This session takes a peek at the inner workings of Oracle’s HotSpot virtual machine, its just-in-time compiler, and the interplay with a computer’s hardware. From this, you will understand the more common optimizations a virtual machine applies, to be better equipped to improve and reason about a Java program’s performance and how to correctly measure runtime!
At first glance, Java byte code can appear to be some low level magic that is both hard to understand and effectively irrelevant to application developers. However, neither is true. With only little practice, Java byte code becomes easy to read and can give true insights into the functioning of a Java program. In this talk, we will cast light on compiled Java code and its interplay with the Java virtual machine. In the process, we will look into the evolution of byte code over the recent major releases with features such as dynamic method invocation which is the basis to Java 8 lambda expressions. Finally, we will learn about tools for the run time generation of Java classes and how these tools are used to build modern frameworks and libraries. Among those tools, I present Byte Buddy, an open source tool of my own efforts and an attempt to considerably simplify run time code generation in Java.
While software engineers can disagree on almost any concept of programming best-practice, the necessity of writing unit tests remains undisputed. With the advent of concurrent applications and the ongoing deprecation of the one-thread-per-request model, unit tests do however miss an increasing fraction of programming errors such as race conditions or dead-locking code. But is it even possible to write tests that revise such errors? In the end, a good unit test is characterized by a determined execution path what effectively prevents the use of concurrency within a single test. However, there are tools and programming principles that allow for unit tests of concurrent code. This talk reviews typical mistakes made when concurrent code is tested and introduces Thread Weaver, a test suite for writing valid unit tests that uncover concurrency-related programming errors.
At first glance, Java byte code can appear to be some low level magic that is both hard to understand and effectively irrelevant to application developers. However, neither is true. With only little practice, Java byte code becomes easy to read and can give true insights into the functioning of a Java program. In this talk, we will cast light on compiled Java code and its interplay with the Java virtual machine. In the process, we will look into the evolution of byte code over the recent major releases with features such as dynamic method invocation which is the basis to Java 8 lambda expressions. Finally, we will learn about tools for the run time generation of Java classes and how these tools are used to build modern frameworks and libraries. Among those tools, I present Byte Buddy, an open source tool of my own efforts and an attempt to considerably simplify run time code generation in Java. (http://bytebuddy.net)
While most bugs reveal their cause within their stack trace, Java’s OutOfMemoryError is less talkative and therefore regarded as being difficult to debug by a majority of developers. With the right techniques and tools, memory leaks in Java programs can however be tackled like any other programming error. This talks discusses how a JVM stores data, categorizes different types of memory leaks that can occur in a Java program and presents techniques for fixing such errors. Furthermore, we will have a closer look at lambda expressions and their considerable potential of introducing memory leaks when they are used incautiously.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
Launch Your Streaming Platforms in MinutesRoshan Dwivedi
The claim of launching a streaming platform in minutes might be a bit of an exaggeration, but there are services that can significantly streamline the process. Here's a breakdown:
Pros of Speedy Streaming Platform Launch Services:
No coding required: These services often use drag-and-drop interfaces or pre-built templates, eliminating the need for programming knowledge.
Faster setup: Compared to building from scratch, these platforms can get you up and running much quicker.
All-in-one solutions: Many services offer features like content management systems (CMS), video players, and monetization tools, reducing the need for multiple integrations.
Things to Consider:
Limited customization: These platforms may offer less flexibility in design and functionality compared to custom-built solutions.
Scalability: As your audience grows, you might need to upgrade to a more robust platform or encounter limitations with the "quick launch" option.
Features: Carefully evaluate which features are included and if they meet your specific needs (e.g., live streaming, subscription options).
Examples of Services for Launching Streaming Platforms:
Muvi [muvi com]
Uscreen [usencreen tv]
Alternatives to Consider:
Existing Streaming platforms: Platforms like YouTube or Twitch might be suitable for basic streaming needs, though monetization options might be limited.
Custom Development: While more time-consuming, custom development offers the most control and flexibility for your platform.
Overall, launching a streaming platform in minutes might not be entirely realistic, but these services can significantly speed up the process compared to building from scratch. Carefully consider your needs and budget when choosing the best option for you.
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteGoogle
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-pilot-review/
AI Pilot Review: Key Features
✅Deploy AI expert bots in Any Niche With Just A Click
✅With one keyword, generate complete funnels, websites, landing pages, and more.
✅More than 85 AI features are included in the AI pilot.
✅No setup or configuration; use your voice (like Siri) to do whatever you want.
✅You Can Use AI Pilot To Create your version of AI Pilot And Charge People For It…
✅ZERO Manual Work With AI Pilot. Never write, Design, Or Code Again.
✅ZERO Limits On Features Or Usages
✅Use Our AI-powered Traffic To Get Hundreds Of Customers
✅No Complicated Setup: Get Up And Running In 2 Minutes
✅99.99% Up-Time Guaranteed
✅30 Days Money-Back Guarantee
✅ZERO Upfront Cost
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
Transform Your Communication with Cloud-Based IVR SolutionsTheSMSPoint
Discover the power of Cloud-Based IVR Solutions to streamline communication processes. Embrace scalability and cost-efficiency while enhancing customer experiences with features like automated call routing and voice recognition. Accessible from anywhere, these solutions integrate seamlessly with existing systems, providing real-time analytics for continuous improvement. Revolutionize your communication strategy today with Cloud-Based IVR Solutions. Learn more at: https://thesmspoint.com/channel/cloud-telephony
4. Scope
Task module descriptor
module descriptor
deployment descriptor
build execution descriptor
API for custom tasks
runtime
compile-time
build-time
Type declarative declarative/programmatic
Unit Java package (sub-)project
5. api/Foo.class internal/Qux.class api/Bar.class internal/Baz.class
api/Foo.class internal/Qux.class api/Bar.class internal/Baz.class
(system) class path
Modularity prior to Java 9 is emulated by class loader hierarchies. By tweaking class
loaders to define multiple parents, it is also possible to run several versions of the
same module (e.g. OSGi).
6. api/Foo.class internal/Qux.class api/Bar.class internal/Baz.class
api/Foo.class internal/Qux.class api/Bar.class internal/Baz.class
module loader
example.foo
example.bar
“example.bar reads example.foo”
The integrity of the module graph is verified by the Java 9 runtime. Jars without a
module-info.class are typically contained by the unnamed module that reads all modules.
7. module example.qux {
exports example.bar;
}
module example.foo {
requires example.foo;
exports api;
}
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>qux</artifactId>
<version>1</version>
</project>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>bar</artifactId>
<version>1</version>
</project>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>foo</artifactId>
<version>1</version>
</project>
module example.bar {
requires example.foo;
}
module example.bar {
requires transitive
example.foo;
}
Imports are non-transitive by default (what is a good default for a runtime module system).
9. module example.bar {
requires example.foo;
requires java.xml;
}
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>foo</artifactId>
<version>1</version>
</project>
module java.base {
exports java.lang;
exports java.io;
exports java.util;
// ...
}
module java.xml {
exports org.xml.sax;
// ...
}
Modules can use non-modularized code as automatic modules (referenced by jar name).
Automatic modules export every package and import any module.
Automatic modules should only be used locally to avoid depending on a name.
example-foo-1.jar
10. module java.base {
exports java.lang;
exports java.io;
exports java.util;
// ...
}
module java.xml {
exports org.xml.sax;
// ...
}
module example.foo {
exports api;
// ...
}
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>bar</artifactId>
<version>1</version>
</project>
Non-modularized code can still run on the class path within the unnamed module.
The unnamed module imports any module but does not export any packages.
13. module java.base {
exports java.lang;
exports java.io;
exports java.util;
// ...
}
import sun.misc.Unsafe
module jdk.unsupported {
exports sun.misc;
// ...
}
module example.bar {
requires jdk.unsupported;
}
Despite its name, the jdk.unsupported module is also contained in regular JVMs.
14. module sample.app {
requires foo.bar.qux;
requires some.lib;
}
java -p foo-bar-1.0.jar Main
java -p foo-bar-qux.jar Main
name version
module sample.app {
requires foo.bar.qux;
}
module some.lib {
requires foo.bar;
}
Automatic module names are instable because of:
1. The inpredictability of a jar's file name
2. The inpredictability of a dependencys future module name
Module names should follow the reverse DNS convention known from package names.
Ideally, a module name should be equal to the module's root package.
Avoid an impedance mismatch between module names and (Maven) artifact ids.
Automatic module names and module naming convention.
throws ResolutionException
Module-Name: foo.bar.qux
15. class foo.Bar class pkg.Main
Loading a class from the class path.
java
–cp first.jar:second.jar:third.jar
pkg.Main
Class<?> load(String className) {
for (JarFile jarFile : getClassPath()) {
if (jarFile.contains(className)) {
return jarFile.load(className);
}
}
throw new ClassNotFoundException(className);
}
class foo.Bar
Packages can be split among jars unless they are sealed. Yet, sealing is vulnerable.
search
order
16. Loading a class from the module path.
Map<String, Module> packageToModule;
Class<?> load(String className) {
Module module = packageToModule.get(pkgName(className));
if (module != null && module.contains(className)) {
return module.load(className);
}
throw new ClassNotFoundException(className);
}
example.foo example.bar
Module-Package-ownership: split packages or concealed packages are no longer permitted.
java
–p first.jar:second.jar:third.jar
–m example.foo/pkg.Main
18. package library;
class Api {
@Deprecated
String foo() {
return "foo";
}
String bar() {
return "bar";
}
}
package library;
class Api {
String foo() {
return "foo";
}
}
Dealing with "jar hell"
package library;
class Api {
String bar() {
return "bar";
}
}
library-1.0.jar library-2.0.jar
Api api = new Api();
api.foo();
second-library-1.0.jar
Api api = new Api();
api.bar();
third-library-1.0.jar
throws NoSuchMethodError
19. package library;
class Api {
String foo() {
return "foo";
}
}
package library;
class Api2 {
String bar() {
return "bar";
}
}
library-1.0.jar library-2.0.jar
Class<?> entryPoint = ModuleLayer.empty()
.defineModules(
Configuration.resolve(ModuleFinder.of(modsDir),
Collections.emptyList(),
ModuleFinder.of(), // no late resolved modules
Collections.singleton("my.module")),
name -> makeClassLoader(name)
).layer().findLoader("my.module").loadClass("my.Main");
With little tweaking, the JPMS is however already capable of isolating packages:
20. Jars, modular jars and jmods.
javac
-d target
src/module-info.java src/pkg/Main.java
jar
--create
--file lib/example.foo.jar
--main-class=com.greetings.Main
-C target
.
jmod
create
--class-path target
--main-class=com.greetings.Main
lib/example.foo.jmod
JMOD
A jar file containing a module-info.class is considered a modular jar.
Both the jar and the jmod tool support a --module-version parameter.
Versions are however not currently a part of JPMS, “jar hell” is therefore not averted.
21. Linking modules prior to execution.
jlink
–-module-path ${JAVA_HOME}/jmods:mods
--add-modules example.foo
--launcher run=example.foo/pkg.Main
--output myapp
/myapp
/bin
java
run
/conf
/include
/legal
/lib
release./myapp/bin/run
Hello world!
du –hs myapp
44M myapp
./myapp/bin/java --list-modules
example.foo
java.base@9
Jlink (as of today) can only process jmods and modular jars.
22. package api;
public class SomeClass {
public void foo() {
/* do something */
}
private void bar() {
/* do something */
}
}
Method foo = SomeClass.class.getMethod("foo");
foo.invoke(new SomeClass());
Method bar = SomeClass.class.getDeclaredMethod("bar");
bar.setAccessible(true); // check against security manager
bar.invoke(new SomeClass());
Reflection and breaking encapsulation
module example.foo {
opens api;
}
open module example.foo { }
JVM modules do not open any of their packages (unless specified on the command line)!
java --add-opens
java --illegal-access=<permit,deny>
Module::addOpens
Instrumentation::redefineModule
24. module java.base {
exports java.lang;
// ...
}
module my.library { }
Field value = String.class.getDeclaredField("value");
value.setAccessible(true); // java.lang is not 'open'
Reflection against closed APIs is not discovered by the jdeps tool.
An existing class-path application that compiles and
runs on Java SE 8 will, thus, compile and run in
exactly the same way on Java SE 9, so long as it only
uses standard, non-deprecated Java SE APIs.
An existing class-path application that compiles and
runs on Java SE 8 will, thus, compile and run in
exactly the same way on Java SE 9, so long as it only
uses standard, non-deprecated Java SE APIs,
excluding the use of reflection on non-public members.
JPMS
group
25. package java.lang;
public class ClassLoader {
protected Class<?> defineClass(String name, byte[] b,
int off, int len) {
/* define class and return */
}
}
public class MyBean
{
public void foo() { }
void bar() { }
}
public class ProxyBean extends MyBean
{
@Override public void foo() { }
@Override void bar() { }
}
MyBean mock = Mockito.mock(MyBean.class);
MyBean persisted = entityManager.merge(myBean);
MyBean bean = applicationContext.getBean(MyBean.class);
ClassLoader proxyLoader = new ProxyClassLoader(parent);
Class<?> proxy = proxyLoader.loadClass("ProxyBean");
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.defineClass(classFile);
MethodHandle bar = lookup.findVirtual(MyBean.class,
"bar",
MethodType.methodType(void.class);
bar.invoke(new MyBean());
MyBean mock = Mockito.mock(
MyBean.class, MethodHandles.lookup());
26. module my.library {
requires jdk.unsupported;
}
module jdk.unsupported {
exports sun.misc;
opens sun.misc;
// ...
}
module java.base {
exports java.lang;
// ...
}
Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
theUnsafe.setAccessible(true);
Unsafe unsafe = (Unsafe) theUnsafe.get(null);
unsafe.defineClass( ... );
package java.lang;
public class Accessor {
public void access() {
// within module
}
}
module my.library { }
Field value = String.class.getDeclaredField("value");
value.setAccessible(true); // java.lang is not 'open'
28. public class SomeHttpClient {
void call(String url) {
try {
Class.forName("org.apache.http.client.HttpClient");
ApacheDispatcher.doCall(HttpClients.createDefault());
} catch (ClassNotFoundException ignored) {
JVMDispatcher.doCall(new URL(url).openConnection());
}
}
}
module library.http {
requires static
httpclient;
}
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>2.0</version>
<optional>true</optional>
</dependency>
</dependencies>
Could be substituted by using a service loader and modules that implement the binding.
29. module my.app {
requires spring;
opens beans;
}
module my.app {
requires spring;
requires careless.lib;
opens beans to spring;
}
module my.app {
requires spring;
requires careless.lib;
opens beans;
}
module spring {
// ...
}
module careless.lib {
// has vulnerability
}
class Util {
void doCall(String httpVal)
throws Exception {
Class.forName(httpVal)
.getMethod("apply")
.invoke(null);
}
}
It is also possible to qualify exports statements for the creation of friend modules.
This can be useful for priviledged modules within the same module family.
30. module my.app {
requires web.framework;
opens app;
}
URL ressource = getClass().getResource("/foo/bar.txt");
Resources are only visible to other modules if:
1. They reside in an exported package
2. Belong to the module conducting the lookup
3. Reside in a folder that is not a legal package-name (e.g. META-INF)
4. End with .class
/app/MyWebPage.java
/app/MyWebPage.html
abstract class BaseWebPage {
URL findTemplate() {
String name = getClass()
.getSimpleName() + ".html";
return getClass()
.getResource(name);
}
}
module web.framework {
// ...
}
module my.app {
requires web.framework;
}
class MyWebPage
extends BaseWebPage {
/* ... */
}
35. Java platform module system: the controversy
Are modules even (still/even) useful?
Considering microservices, modules are often the better option, both considering
maintainability and performance. We have always used modules with Maven; adding
first-level support offers a chance to better interact with them at runtime.
Think of what we could have instead of Jigsaw in the time it took!
Remember the last time you had to defend a refactoring/maintenance release?
You should always clean up before you expand your feature set.
Java modules breaks all the things!
The "growth only" model is not sustainable if Java should have a future. The JVM
must at some point apply breaking changes to survive/strive.
To make full use of Java, some code needs to cross module boundaries!
Nobody relies on internal APIs for laziness but because it is necessary. Without the
openness of sun.misc.Unsafe in the past, a lot of libraries that make the JVM such
an attractive choice would not exist today. The standard library only offers basic
functionality by design. Especially test libraries and tooling have a legitimate wish
to "cross the line". As of today, any code can however still use Unsafe to leverage
low-level functionality. The standard library still relies heavily on qualified exports!