~/talk

Programming with ServiceLoader API in Java

Talkat Great International Developer Summit 2023 · 2023-04-25..04-28· [java]
slides:none on file

Demonstrates using ServiceLoader with Java modules to build a plugin-style soft‑drink example (softdrink interface, Coke/DietCoke and Pepsi/DietPepsi modules compiled to JARs) and runs a client on the command line; shows module descriptors using module provides/uses instead of exports, uses java.util.ServiceLoader for dynamic discovery, supports factory/static provider methods for non‑default constructors, shows lazy instantiation and caching, a reload() option, and streaming providers so metadata (annotations/types) can filter implementations.

AI-written summary · about

  1. 0:00Introduction to Java modules
  2. 0:59Limitations of Java 8
  3. 2:12The Java module system
  4. 4:14The need for dynamic discovery
  5. 6:06Understanding plugin architecture
  6. 8:40Problems with reflection
  7. 11:15Introduction to Service Loader
  8. 13:20Creating the service interface
  9. 17:41Implementing the client module
  10. 23:28Implementing a provider
  11. 31:42Lazy loading and provider methods
  12. 40:57Caching and reloading services
  13. 44:26Functional style with streams
  14. 52:24Conclusion and summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.