watson-developer-cloud / dotnet-standard-sdk

:new::new::new:.NET Standard library to access Watson Services.
https://www.nuget.org/profiles/ibm-watson
Apache License 2.0
148 stars 117 forks source link

Requirements for open source #2

Closed mediumTaj closed 7 years ago

mediumTaj commented 7 years ago
mediumTaj commented 7 years ago

I don't know if this is helpful but I copied and pasted our conversation from GHE repo


degrim @asantiago Regarding the name, I would suggest dotnet-core-sdk or dotnet-standard-sdk. dotnet-standard-sdk would indicate that this library is based on the .NET Standard, making it compatible with .NET Core, .NET Framework, and others (once upgraded to .NET Standard 2.0). It would also be nice to see some extension methods added for ASP.NET Core (would be best to add these in a separate project/nuget package as they would only be applicable to ASP.NET Core) which could configure the services for use in ASP.NET Core on Bluemix using the VCAP_SERVICES environment variable. See the Visual Recognition sample that I wrote for an example of this.


asantiago @degrim Agreed... I like dotnet-standard-sdk. Thanks for your input! Feel free to jump in on any of this - This project will eventually be transferred to Watson Developer Cloud Open Source so we need to start a community of .NET developers contributing to this SDK!


atosta @degrim At the beginning of development, I got to build using using configuration objects and options but we had some compatibility issues with previous .Net Framework summers. We still have this task in the backlog.

@degrim / @asantiago with respect to the name i like the dotnet-standard-sdk, but what about the assembly name? Continue Will we keep IBM.WatsonDeveloperCloud?


asantiago @atosta What is standard for assembly names in .NET? Is there any analog for assembly name in java, node or python? If there is can you check the other WDC SDKs?


degrim @atosta I don't think it's necessary to use the Options pattern, simple DI of POCOs would be fine here, and that would be a more generic approach for supporting more than just ASP.NET as those objects could just be manually passed into the constructors in other scenarios.

@asantiago I think it makes sense to follow the general pattern of ...

For example, these are some existing NuGet packages: Microsoft.AspNetCore.Mvc IBM.Data.DB.Provider

Suggested names for the SDK packages would be something like these: IBM.Watson.Sdk.VisualRecognition IBM.Watson.Sdk.SpeechToText


degrim @atosta Regarding how credentials are set, the current method of calling .SetCredentials on the service would probably be fine too if the services are registered as Singletons in the DI framework. That would also eliminate the need to have a separate class just for storing credentials too.


atosta @asantiago / @degrim The repository and assembly name have been discussed in the past with German. He had suggested this IBM.WatsonDeveloperCloud. It is even consistent with Java SDKs, Unity, and so on. @degrim Our initial intention was this, to use a DI, Option pattern or some other kind of pattern that solved this, but since the volume of things to be developed were large, we opted for a simpler solution initially, which does not prevent us from constructing this In the near future.


degrim @atosta IBM.WatsonDeveloperCloud should be fine if that's consistent with the Java SDK, it will still be easy enough to find when searching nuget.org. Regardless of what method we use to configure the credentials, it should be easy enough to provide extension methods in a separate package (ex: IBM.Bluemix.Extensions.WatsonDeveloperCloud) for different scenarios. In this example, the IBM.Bluemix.Extensions.WatsonDeveloperCloud package would provide nothing more than extension methods for configuring the Watson SDK using the credentials provided by Bluemix similar to what I did in the Visual Recognition sample.

mediumTaj commented 7 years ago

@atilatosta from German:

Let's make sure we read VCAP_SERVICES when running in Bluemix.
atilatosta commented 7 years ago

@mediumTaj I think that this responsibility is of the client application, because the SDK may not be running in the Bluemix environment. But, I had thought in add options by dependency injection, where the client application would add the options. What do you think?

itzunagi commented 7 years ago

@atilatosta @mediumTaj I think that it might make sense to have some extension methods in a separate package that register some type of Credentials object with DI for use in ASP.NET, that way the primary SDK only has to accept a POCO as a parameter to it's constructor and the code for the DI doesn't have to live in the main SDK so there aren't unnecessary dependencies added for users who aren't using ASP.NET (or Bluemix).

mediumTaj commented 7 years ago

Yeah I'm not 100% sure about including this in the SDK either. German seems to want it in there, probably for demo purposes. I agree, a separate package with this functionality would be better.

Here's German's implementation in Java SDK

https://github.com/watson-developer-cloud/java-sdk/blob/36d98ef7754db0b1d545e1b478d1ca3740445f59/core/src/main/java/com/ibm/watson/developer_cloud/util/CredentialUtils.java

atilatosta commented 7 years ago

Yeah! I agree to create a separate package for it.

germanattanasio commented 7 years ago

That sounds good