Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • was +1 other than "Be independent of the framework/db" There is more to db independence than being able to switch databases. It is also about being able to performance optimize your persistence when needed by making drastic structural changes. It is about being able to unit test the code that is interesting to unit test. And, also, about avoiding crappy code that is just a mirror of the DB. Other than that, the rest of the answer deserves 10 upvotes Commented Feb 14, 2018 at 21:45
  • @TheCatWhisperer: I would think that the goal would be to avoid drastic structural changes at all costs. Otherwise, why bother with all this indirection? If you design your data access layer correctly, you can have your generic repository that's database independent, provide a way to tailor your SQL in those areas that need performance tuning (in a vendor-specific way, if necessary), and get the best of both worlds. Commented Feb 14, 2018 at 21:56
  • Sorry, my comment was not clear. You wrote, in response to, "Be independent of the framework/db"..."The value of this requirement is debatable unless you know you're going to change frameworks later on." Commented Feb 14, 2018 at 22:05
  • "in practice only SQL Server is used" I have to disagree with this statement as I know of a lot of work being done with EF+Postgres and EF+MySQL. And this is not only hobby projects. You are likely correct that most work is done with EF+SQL Server. Commented Feb 14, 2018 at 22:12
  • @TheCatWhisperer: Yes, I understood what you meant. I stand by my statement that large-scale structural changes are something you want to avoid. Commented Feb 14, 2018 at 23:06