Split NugetHelper code into separate classes#560
Conversation
|
I think it makes sense. This is and will most probably stay a project that only handles nuget packages so repeating Nuget in every class name is redundant. |
igor84
left a comment
There was a problem hiding this comment.
Nicely done. Interesting that you embraced procedural style (with all the static classes) :).
I thought about creating classes but I couldn't find a good separation, and as Unity always reloads the AppDomain when we install / uninstall a package the classes couldn't live long enough to get a advantage. So currently the static classes manage there state by themselves and 'Lazy' load all required information from the file system. Normally I am strongly against static fields or properties but as NuGetForUnity "lives" inside the Unity Editor and therefore has no possible Multi-Threading / scoping issues that come with static-lifetime I found it acceptable. @igor84 |
|
I agree with your reasoning. It makes sense in this case. From where I'm standing |
Moved code from
NugetHelperNuGet.configmanagement (loading / active source) ->ConfigurationManagerFileSystemHelperpackages.config->InstalledPackagesManagerNugetCacheManagerNugetCliHelperNugetLoggerNugetPackageContentManagerNugetPackageInstallerNugetPackageRestorerNugetPackageUninstallerNugetPackageUpdaterUnityPathHelperWebRequestHelperThere is still code that needs to be refactored but I wanted to start creating a structure so when we e.g. split the
Installmethod that still has 178 lines of code the code has a 'place' and is not hidden in a 1600 lineNugetHelper. Eventually we should move some files into folders. Im also not sure about the naming currently most files/classes have aNuget-prefix eventually we can remove some of them e.g.NugetPackageInstallervsPackageInstaller.@igor84 what do you thing about this.