Jan 6, 2019 9:16 AM 2+ week ago
Super Charge the Module Aware Service Loader in Java 11 Like by Key Takeaways A Java module is a self-contained, self-describing component that hides internal details and provides interfaces, classes, and services for consumption by clients A service is a set of well-known interfaces or classes (usually abstract). A service provider is a concrete implementation of a service. Java’s ServiceLoader is a facility to load service providers that implement a given service interface. Java’s service loading mechanism can be extended through a library to reduce the boilerplate code and provide useful features like injecting service references and activating a given service provider. If you had a chance to use the Simple Logging Facade for Java (SLF4J) in one of your Java projects, you know that it allows you, the end-user, to plug-in your choice of a logging framework like java.util.logging (JUL) or logback or log4j at deployment time. During development, you typically use the SLF4J API which provides an interface or an abstraction that you can use to log your application messages. Say, during deployment you initially chose JUL as your logging framework but then you noticed that the logging performance is not up to par. Because your application is coded to the SLF4J interface, you can easily plug-in a highly performant logging framework like log4j without any code changes and redeploy your app. Your application is in essence an extensible application. It has the ability to pick a compatible logging framework that is available on the classpath at runtime through SLF4J. An extensible application is one whose specific parts can be extended or enhanced without the need for code changes to the application’s core code base. In other words, the application allows for loose coupling by programming to interfaces Read more.
**Content contained on this site is provided on an “as is” basis. 4Internet, LLC makes no commitments regarding the content and does not review it, so don't assume that it's been reviewed. What you see here may not be accurate and should not be relied upon. The content does not necessarily represent the views and opinions of 4Internet, LLC. You use this service and everything you see here at your own risk. Content displayed may be subject to copyright. Content is removed on a case by case basis. To request that content be removed, contact us using the following form: Contact Us.