News for hackers. Stuff that matters.
Re:Object-Relational Mapping is the Vietnam of Computer Scie... by snomad on Thursday February 27, 2014 @12:24AM (#7310531)
For the past few years, I abandoned the ORM and went straight to Stored Procedures using Data Transfer Objects / DAOs. It is no panacea, but has worked well for these reasons:

1. I can grep all of my SQL! No dynamic SQL generation means all SQL statements are known. This alone has been huge to me. Of course it depends on storing the SPs in version control and settling on good naming conventions (eg. always write table.column). 2. The SPs are easily testable and verifiable endpoints to themselves. 3. Small Performance boost of using compiled / validated SQL. 4. No dynamic SQL also means that performance tuning is a snap. I see a bad actor I can track it down easily and fix the problem.

One thing that has made this possible is a convention of naming SPs by tablename_DMLname_[description]. e.g. customer_sel_byemail.

Re:Object-Relational Mapping is the Vietnam of Computer Scie... by jmnicolas on Thursday February 27, 2014 @02:55AM (#7310931)
What is "DMLname" in "tablename_DMLname_[description]" ?
Re:Object-Relational Mapping is the Vietnam of Computer Scie... by 9876543210 on Thursday February 27, 2014 @06:46AM (#7311640)
A named query, or any other form of named SQL statement.

It could be a view (a select query, stored as a database object) or a procedure (a grouped set of sql statements that might involve changes that are written to the database, possibly a simple insert, or simple update, or simple delete, but potentially much more complex).

DML is one class of SQL statements, and DDL is another. The two together encompass most of your common, practical database operations.

Re:Object-Relational Mapping is the Vietnam of Computer Scie... by sime on Thursday February 27, 2014 @06:35AM (#7311605)
DML is short for data manipulation language as opposed to DDL which is data definition language. So in this case it's including in the stored proc name the type of data manipulation operation being performed by the proc. In the example "sel" is short for select so it's a query operation. You would also have insert, update and delete.
Re:Object-Relational Mapping is the Vietnam of Computer Scie... by jmnicolas on Thursday February 27, 2014 @08:28AM (#7311969)
Got it, thank you both.