We really don’t have much choice. With JPMS you really need to use 
ServiceLoader to locate things like plugins across modules. Using a s file like 
spring.factories doesn’t really help anyway. You wouldn’t want to force users 
to hand create the entries in that file and so would use annotations and a 
processor to populate it, which is exactly what we are doing.

Ralph

> On Oct 23, 2023, at 10:12 AM, Gary Gregory <garydgreg...@gmail.com> wrote:
> 
> Staying from the built-in Service Loader is a recipe for even more
> custom code and complications. I say we stick with the built-in
> Service Loader.
> 
> Gary
> 
>> On Sun, Oct 22, 2023 at 5:01 PM Piotr P. Karwasz
>> <piotr.karw...@gmail.com> wrote:
>> 
>> Hi Matt,
>> 
>>> On Sun, 22 Oct 2023 at 22:49, Matt Sicker <m...@musigma.org> wrote:
>>> So now we come to your question about a factories file. That’s an 
>>> interesting idea, though it’s extremely similar to what we’re doing here 
>>> with ServiceLoader (though the split between META-INF/services/ files and 
>>> module-info.java provides/uses entries is confusing). Moving away from 
>>> ServiceLoader to a custom mechanism might be more flexible, though I’m not 
>>> very knowledgeable about how Java modules work with them.
>> 
>> I think that `ServiceLoader` is the only standard feature that is
>> supported by both OSGi and JPMS. If we move away from it, we'll need
>> some custom code to support it (or `opens`, etc). I wouldn't go that
>> way.
>> 
>> Piotr

Reply via email to