git-machete-intellij-plugin icon indicating copy to clipboard operation
git-machete-intellij-plugin copied to clipboard

Do we need Providers in `com.virtuslab.gitmachete.frontend.ui.providerservice`?

Open PawelLipski opened this issue 3 years ago • 1 comments

All 3 of them just call RuntimeBinding.instantiateSoleImplementingClass(...)... maybe just use RuntimeBinding.instantiateSoleImplementingClass directly then, without the intermediate layer of @Services?

PawelLipski avatar Oct 21 '22 13:10 PawelLipski

Also, if they stay, let's decide whether they're "services" or "(service) providers" and reflect that everywhere in the naming

PawelLipski avatar Oct 21 '22 13:10 PawelLipski

Re-assigning to @LukaszKontowski as his probably final task in this project 🏁

PawelLipski avatar Oct 31 '22 15:10 PawelLipski

From a quick look, services are "per-project singletons"... so com.virtuslab.gitmachete.frontend.ui.providerservice.BranchLayoutWriterProvider is redundant, but the other two service look quite useful.

TBD whether to get rid of these two, or maybe the other way round: (re)implement more per-project things as services

PawelLipski avatar Nov 04 '22 13:11 PawelLipski

Although we rather have per-VCS-root singletons, not per-project singletons

PawelLipski avatar Nov 04 '22 13:11 PawelLipski

Load balancing...

PawelLipski avatar Nov 16 '22 14:11 PawelLipski

My proposal: The classes in question are Services since that's the IntelliJ nomenclature, their names can stay as they are I think, since they are services used to obtain some values, thus Provider suits them. So just rename package to services.

Maybe GitMacheteRepositoryCache could also get its own Provider service?

MaciejG604 avatar Nov 21 '22 15:11 MaciejG604

Maybe GitMacheteRepositoryCache could also get its own Provider service?

Hmmm okay... pls provide a PoC!

PawelLipski avatar Nov 21 '22 15:11 PawelLipski

The answers can be found in the linked PRs

PawelLipski avatar Nov 23 '22 22:11 PawelLipski