[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-jigsaw-dev
Subject: =?UTF-8?B?V2h5IHNlcnZpY2UgcHJvdmlkZXIgbWV0aG9kIGlzIGNhbGxlZCAicHJvdmlk?= =?UTF-8?B?ZXIiLCBidXQgbm90I
From: Alex Orlov <ooo_saturn7 () mail ! ru>
Date: 2020-11-20 11:48:21
Message-ID: 1605872901.664296638 () f747 ! i ! mail ! ru
[Download RAW message or body]
Hello all,
According to this tutorial \
https://www.logicbig.com/tutorials/core-java-tutorial/modules/service-provider-method.html
we can declare in module-info provider class with "provider" method. For example,
......
public class TheServiceProvider {
public static AService provider() {
return new AServiceImpl();
}
}
The only thing what I don’t understand is why this method is called "provider". The \
method doesn’t return provider, method returns an instance of the service, so, as I \
understand, the method must be named "provide". And, as I understand, provider is \
usually the class, that has "provide" method.
Of course that’s not very important, but it is JDK, so it was developed by very \
experienced java developer who should know java naming convention and I want to \
understand why this did so. Could anyone explain?
--
Best regards, Alex Orlov
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic