Closed adamralph closed 9 years ago
Both of these are not pure YAGNI but are kind of YAGNI, you will need to make a call on them.
The first case is easy and is more about design. The requests are structured to match the hierarchy in https://github.com/Haacked/NuGet/tree/master/src/CommandLine/Commands . So to keep it or collapse it is up to you. I'm happy with current functionality and see no need for it to be expanded at the moment.
The second case is more complicated and for technical reasons. The reason for using a generic and non generic type have more to do with some of the fluent methods being extension methods. Generic inference does not work so well with methods of the form A Method<A,B>(A thing) where A:ABase<B> where B:BBase
so those extension methods were applied to the non-generic type while the real logic is within the generic type. Looking back an interface would probably have been better. It may soon not mater as most of the complexity as due to the intent to support both command line and NuGet.Core. After #8 is done this should be looked at again with a fresh perspective and hopefully we can get rid of the generics entirely.
Thanks for the explanations!
NuGetCliBauTaskBase
no longer exists so that solves the hard problems.
Consider merging download into restore instead of commandbase.
NuGetCliDownloadCommandRequestBase
be folded down intoNuGetCliRestoreCommandRequest
?NuGetCliBauTaskBase
be folded down intoNuGetCliBauTaskBase<TRequest>
?At the moment, in each of those cases there is a single inheritor so it seems they can be collapsed, in the name of YAGNI.