| ▲ | mrkeen 4 hours ago | |
It's the definition of simple that's the problem. For any definition of simplicity you might have, someone has an equal and opposite definition. Take these two alternatives:
There are some coworkers who will veto the first example for being too complex, because it brings Postgres (and its state and connections and exceptions and mappings) into the scope of what otherwise could have been a service concerning Users.There are some coworkers who will veto the second example for being too complex, because Postgres is all you use for now, and if you really need to use a second database, you can change the code then (YAGNI). Also the Interface gives you a pointless indirection that breaks IntelliSense so you can't just 'click-through' to follow the code flow. | ||
| ▲ | tumetab1 an hour ago | parent [-] | |
I agree with your comment, but I disagree a both the example opinions... complex is the discussion :D I heard something that helps better framing those discussions, use "familiar" instead of "simple". An highly abstract way to access a database table, with ORM for example, can be simple because everyone is expecting it and knows how to do all tasks (changing schema, troubleshooting, managing transactions, etc.). Doing userService.pgSql("select ....") in the same way can be simple. | ||