Fitbit.NET icon indicating copy to clipboard operation
Fitbit.NET copied to clipboard

OAuth2 namespace removal

Open WestDiscGolf opened this issue 9 years ago • 5 comments

I'm not a fan of it being in a separate namespace.

image

Don't see what it gives us ... ?

WestDiscGolf avatar Feb 18 '16 20:02 WestDiscGolf

Structure.

mxa0079 avatar Feb 18 '16 22:02 mxa0079

I don't disagree but the reason why I'm not a fan is the readability of it with the namespace as well makes the naming of it look odd eg Fitbit.Api.Portable.OAuth2.OAuth2Helper. So its the OAuth2 OAuth2 helper? It should either be Fitbit.Api.Portable.OAuth2Helper or the Fitbit.Api.Portable.OAuth2.Helper.

Thoughts?

WestDiscGolf avatar Feb 19 '16 21:02 WestDiscGolf

I agree the repeat wording in the namespace is not ideal, but consumers of the library will most likely not use the fully qualified name when instantiating classes, so they will only see OAuth2Helper. If we remove the OAuth2 prefix, then we will remove clarity as well -- consumers will only see Helper. A helper for what?

In summary, we gain structure in our code base (sorely needed), isolates a subset of the code that should be isolated, and adds clarity of intent (consumers of the library know that all these classes are related to OAuth2) at the cost of an additional namespace.

I believe it is well worth it.

mxa0079 avatar Feb 19 '16 21:02 mxa0079

I don't disagree about the code base structure but I believe this is similar to the discussion we had with regards to the FitbitClient.cs size - structure to the source of the library is for us to aid with development is different to namespacing we expose in the consumer of the library. If anything the namespace should be something like Authorization or Security or something more encompassing of everything and then the OAuth1 related classes should be in it as well. Then the name OAuth2Helper makes sense.

WestDiscGolf avatar Feb 19 '16 21:02 WestDiscGolf

@aarondcoleman Tried out the "Security" namespace option route and tbh I'm not 100% sure what it gives us. I still think I prefer the folder structure in the solution to give structure but keep all the classes in the "Fitbit.Api.Portable" namespace. I think with the subtle renaming of some of the classes/interfaces I think it will be clearer - https://github.com/WestDiscGolf/Fitbit.NET/tree/issue-134

Thoughts?

WestDiscGolf avatar Jun 10 '16 22:06 WestDiscGolf