wwj-go commented on issue #1546:
URL: 
https://github.com/apache/shardingsphere-elasticjob/issues/1546#issuecomment-705395078


   @TeslaCN hi,thanks for your reply. I have read the code you said in 
https://github.com/apache/shardingsphere , and I find that someone have merge 
it into this project named `ElasticJobServiceLoader`. 
   Personally, from a performance perspective,I think its not a good design.
   1.` register(final Class<T> service)` just save the classes not 
instances,this is equivalent to saying that instantiation of java SPI is not 
necessary and is a waste.
   2. Every time call  `newServiceInstances(final Class<T> service)`  will 
reinstantiate all implements and for the caller like 
`ElasticJobListenerFactory、 JobErrorHandlerFactory`, just use the first 
implement and discard the rest , it is a serious waste.
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to