• addie@feddit.uk
    link
    fedilink
    arrow-up
    19
    arrow-down
    1
    ·
    1 month ago

    Abstraction is not very compatible with concurrency, so as well as your your beautiful abstract API, you also need some ‘cut through the layers’ functions to return the underlying classes you need to synchronise on. Now you have a right mess that’s incredibly hard to understand, infuriating to debug, and impossible to refactor. Best you can do is put another layer of abstraction on top. Repeat every six months.

    • 3abas@lemmy.world
      link
      fedilink
      arrow-up
      11
      ·
      1 month ago

      That’s just bad interface… When you design an API as if operations were independent, but they aren’t, you run into these issues.

      Don’t add “cut through the lawyers” functions, fix your interface.

    • Evotech@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      1 month ago

      That’s why you build the api first. If you need to “cut through” anything you build an api for that instead.