Are inner types compromising a good API design?

It seems to me that at any time when I am faced with internal calls or types, I like when I hit the road block.

Even if they are available in open-source code, it still seems like they are not useful parts of the API code itself. those. as if they were not encouraged to modify.

Should someone keep an internal keyword, if absolutely necessary?

I ask for this for the open source API. But still, not everyone will want to change the API, but they mainly use it to write their own code for the application itself.

+3
source share
3 answers

, DLL, API. , - , DLL, , , (, , )

? API - , . API , , DLL.

, . - . , .

+12

- , API. , .

, , , API. . , - , , .

, . API. API , , , .

+8

API , .

I believe that internal types can be very useful, especially if you want to return interface types from your API and don’t want to disclose the specific types that you used to implement these interfaces. This gives the API developer more flexibility.

+5
source

Source: https://habr.com/ru/post/1714539/


All Articles