Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用partial关键字对大文件进行拆分 #27

Open
wsy opened this issue Mar 2, 2024 · 2 comments
Open

使用partial关键字对大文件进行拆分 #27

wsy opened this issue Mar 2, 2024 · 2 comments

Comments

@wsy
Copy link

wsy commented Mar 2, 2024

你们的SDK里有很多上万行的大文件,建议进行拆分。
.Net从很久以前就支持partial关键字,把一个class拆到多个文件里。

比如.Net Runtime的TimeZone类,就拆分了很多文件。
Example

具体到你们sdk里,比如:

https://github.com/aliyun/alibabacloud-csharp-sdk/blob/master/ecs-20140526/core/Client.cs

这个文件3.xMiB,6万多行。
可以改成partial class,按功能拆成Client.Feature1.csClient.Feature2.cs,增加可维护性。

@AndersChen123
Copy link

它们这些代码应该是根据api自动生成的,所以基本都在一个文件里。

@wsy
Copy link
Author

wsy commented Aug 2, 2024

它们这些代码应该是根据api自动生成的,所以基本都在一个文件里。

肯定是脚本生成的,生成器也可以拆分输出结果的。方便别人看。
隔壁友商也是生成的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants