If I have a self-contained server component, that specifies callback
functions, then would it be good practice for:
1) the server component itself to provide a header file with the
callback function declarations
2) the client to implement the function definitions
In this way the server owns the interface (usage, through the
declaration) but the client is responsible for implementation (through
the definition). There is some checking, by (server's) declaration
against (client's) implementation, that the implementation at least
matches the function's declaration.
I have not seen this separation and defined ownership in code that I
have studied, but it seems to me that it should be so. I expected to
find this documented in texts but have not so far found this. It seems
obvious but is not apparently done. I'd value any comments or examples
of how it is done in good practice.
Thanks,
Chris