I looked into the lemmy src, and what is supposed to be a CRUD API has several layers of abstraction. Same at work, where we have hexagonally structured apps where following any sort of logic is literally impossible. What are your thoughts?

  • @xor
    link
    English
    22 years ago

    Using abstractions/patterns poorly is how you end up with applications that are hard to maintain.

    But having no abstractions at all is a recipe for disaster, especially for a large(ish) repo like lemmy.

    If you have a direct db query in each of your endpoints and decide that actually you want to use a different form of database, then you’d have to refactor every single API endpoint.

    But using sensible abstractions lets you separate the details of how your data storage works from how your logic does, and now changing the database is just a case of using the other implementation.