Open sergey-shandar opened 7 years ago
@markcowl, @johanste and @fearthecowboy thoughts on this way of expressing the C# API rather than with namespaces? Thoughts?
@jianghaolu and @anuchandy thoughts from the Java side? I think this might be preferable to the long namespaces. Thoughts?
In general, modeling through classes rather than namespaces gives you more flexibility in C#. Namespaces are a purely compile-time construct.
Another example
abstract class MyCompanyProfile : Service._2017_01_01
{
}
MyCompanyProfile.Model model = new MyCompanyProfile.Model();
@sergey-shandar, please, let's keep profiles as something that we (Microsoft) define. It is not an arbitrary grouping of stuff that 3rd parties put together (or am I misinterpreting the name class name in your example ? :))
@johanste Ok. You are not misinterpreting the name of the class. I was thinking about how other people may use it internally. I agree, this could be not a recommended way to use Azure SDK.
@sergey-shandar what do you think about extending this model to reflect the same scenarios as the current set of samples?
Feel free to completely replace the existing .NET code if you like. We could keep these in two different branches and you could use more applicable namespaces (rather than Service
).
Looks cool!
@devigned yes, I plan to convert the existing samples when I have time.
@sergey-shandar I know you probably have other things going on, but if you can gather a bit of time to expand this, I think it would really help the group. Thx, man!
@jianghaolu and @anuchandy call number two for thoughts from the Java side?
@devigned I've got one problem to use the current set of samples. The samples don't have project files so I could validate that the code is valid. IMHO, we need to provide project files. After that, we and others can play with it and make sure it works with the current C# compiler.
@sergey-shandar just create a branch and burn the existing .net code to the ground. You can do with the new branch as you'd like.
@devigned I've updated the PR.
Assumptions:
@sergey-shandar how would you use multiple profiles together with this strategy similar to how the multi-profile example does (side by side in the same application)?
C# doesn't have typedefs so it's hard to define the same type for specific API version and Latest namespaces. However, there is a workaround for this issue if we use classes instead of namespaces.
old code
new code
Usage