this post was submitted on 17 Jun 2023
0 points (50.0% liked)

Programming

3347 readers
1 users here now

All things programming and coding related. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 2 years ago
MODERATORS
 

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?

you are viewing a single comment's thread
view the rest of the comments
[–] xor 2 points 2 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.