GenFu
GenFu copied to clipboard
Name space and app kernel being named the same causing some pain
Pretty much right there in the title. So for example, when I try to call GenFu.Configure, it doesn't compile because VS thinks I'm making reference to the namespace. If I add using GenFu; to the using directives, it's the same result. At one point, importing other namespaces forced me into actually having to make reference to the GenFu class by typing global::GenFu.GenFu.Configure which was absurd. To fix it, I had to clear my using directives and import everything back in one by one, but still, the best I could come to was GenFu.GenFu.Configure. I'm sure the simple fix would be to rename the main class from GenFu to something else (e.g. GenFu.SomethingElse) to eliminate the ambiguity. This could infact fix the following as well:
also, resharper is ticked about 'A' syntax (i.e. A.ListOf<T>) since it's really accessing a static member of a derived type. It looks like the class is actually empty but deriving from GenFu just for syntactic sugar's sake. I could easily tell resharper to shut it, but I don't want to be modifying my code quality rules just to accomodate the implementation. You may want to consider using composition over inheritance and using A as a static wrapper for GenFu or something along those lines.
+1
Thanks for filing the issue. Seeme like we could fix either the GenFu in GenFu problem or the A syntax issue. I don't agree with Resharper having warnings of this sort but who am I to argue with Resharper?
My thoughts are that we shouldn't change the name of GenFu because it is a public class and people may be relying on it. So that leave us with how we expose all the methods in GenFu to A and Eh. I don't want to have to remember to add methods in 3 places or update them in 3 places. So I'm thinking we generate these classes using T4. Thoughts?
I think it's worth noting that nuget is is versioned so you wont break anyone unless they deliberately update the library. Breaking changes happen. Fact of life. For those pulling directly from the repo, it's the same story imo. So if you were to be ok with that, I think simply changing the genfu application class to "A" would solve both problems.
I also wanted to add support for the argument just for academic sake, if nothing else. From the MS Design Guidelines:
X DO NOT use the same name for a namespace and a type in that namespace. For example, do not use Debug as a namespace name and then also provide a class named Debug in the same namespace. Several compilers require such types to be fully qualified.
https://msdn.microsoft.com/en-us/library/ms229026(v=vs.110).aspx