aplex commented on pull request #3281:
URL: https://github.com/apache/gobblin/pull/3281#issuecomment-849789161


   Note for reviewers: this PR contains only refactoring, so there should not 
be any functionality changes. Many files contain only attribute changes, like 
specifying injection constructor.
   
   A couple of big chunks of logic was moved out of GobblinServiceManager: 
   1. Configuration reading and parsing is now in GobblinServiceConfiguration
   2. Logic to glue classes together moved to GobblinServiceGuiceModule
   
   We use several features of Guice that were not widely used in code base 
before:
   
   1. Marking the class as "@Singleton" - this will make sure that DI framework 
creates only one instance of it. By default, Guice will create a new instance 
of the class for each http request that Gobblin service gets.
   2. Marking constructors as @Inject to specify the one that should be used 
for dependency injection 
   3. Using unique interfaces instead of having named instances (more context 
in the comments where that happens)
   4. Using providers - those are like factories that generate an instance of 
the class for Guice
   5. Using standard javax.Inject annotations instead of using Guice-specific 
ones. They both work in the same way, but using standard once opens us to use 
other DI frameworks if needed in the future.
   
   More info is available in Guice docs: 
https://github.com/google/guice/wiki/MentalModel 


-- 
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