This topic describes the differences between the generic calls and specialized calls that you can make using Alibaba Cloud SDKs. This topic also describes the benefits and limits of generic calls and specialized calls in terms of package size and development experience to help you select an appropriate call method. Sample code is provided to facilitate your project development.
Generic calls
Generalized calls (CommonRequest) use only the Client class and the common parameter configuration class from the core SDK to call OpenAPI operations.
Advantages
Reduces the code package size after integration. You only need to depend on the core SDK even when you use multiple products.
Allows you to call APIs that are published but not listed in the Alibaba Cloud Help Center or the OpenAPI Portal.
Disadvantages
Development requires consulting documentation because code hinting is unavailable.
Specialized calls
Specialized calls use the Client, OpenAPI request, and response classes from a product-specific SDK to call OpenAPI operations.
Advantages
The Client class handles special OpenAPI request logic and common product parameters, which reduces the number of parameters that you must enter. The Request and Response classes encapsulate OpenAPI request and response parameters. This lets you use code hinting to pass parameters and retrieve return values, which improves the developer experience.
Disadvantages
If a product does not have a corresponding Alibaba Cloud SDK, this method cannot be used.
Using multiple products requires you to install a separate SDK for each product, which increases the code package size.
The V1.0 Node.js/TypeScript SDK supports only generalized calls, not specialized calls.
Usage guide
Language | V2.0 SDK | V1.0 SDK | ||
Specialized call | Generalized call | Specialized call | Generalized call | |
Java | ||||
Python | ||||
Node.js | / | |||
Go | ||||
PHP | ||||
.NET | ||||