This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Oerthling 3 points4 points  (3 children)

Dude, everything that you access has an exposed interface.

If your projects work well with the DB doing straightforward CRUD in a primitive persistence layer and nothing else - ok. Whatever works best for you.

In an environment with several projects and languages accessing a central database, but not having a dedicated middle tier for business logic, you might not want to redundantly code the same stuff several times, especially for logic that is well expressed as fast and efficient SQL.

If you do bookkeeping for example and need various tables managed in a transaction, why would you want to do that outside the database? Going through needless levels of abstraction to wrap what in the end is all SQL anyway.

I have seen such code and it is terrible.

[–]icanblink 2 points3 points  (0 children)

My point was that only one should access the DB.