Skip to content

ABI compatibility and separation of public interface and private implementation details on the API #301

Description

@izonfreak

Hello,

I am trying to compile the AdsLib as a shared library on windows and having a hard time dealing with this. There are some things that are missing like the export/import decorators but that is not really the reason why i made this ticket.

To maintain API and ABI compatibility implementation details should be hidden from the public API definition. Exposing internal data structures, class layouts, or implementation-specific types increases dependency between a specific version of AdsLib and the consumer application. This makes it so that any changes made to AdsLib are very likely to break existing code specially if you are compiling AdsLib as a shared library (in any platform).

My suggesting would be to only expose a stable public interfaces by using opaque types and/or the PIMPL pattern (whenever possible) and keeping implementation details private. This way the internals of AdsLib can change and be refactored without affecting users of the API and keeping both source compatibility and in the case of shared library keeping binary compatibility and avoid the need to recompile the application to get a bug fix.

I can help with these changes and we can try to keep as much of the source compatibility with the current interfaces as possible, but I cant guarantee that everything will just "stay the same" since this update will require multiple changes and multiple reviews. Long-term wise I think this will be better than the current approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions