Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it worth use ORM with Stored Procedures

My company's polices forces to use only stored procedures (SP) to talk with DB (no dynamic execution of SELECT, VIEWS on app side available)
Business objects (BO) are fetched from DB.
There is implemented simple BO-DB mapper using SQL Reader and this seems working well.

Form DB side we have one parametrized SPs for each Business Object one SP for all CRUD operations, switched by @MODE parameter) So we don't have separate SP like SP_INSERT, SP_UPDATE, SP_SELECT etc ...

I have read recently lot about linq2SQL, nHibernate, Subsonic etc and those look very interesting.
I noticed main ORM's benefit is flexible queries execution / filtering directly from c# code - in my word I cannot execute such (only SP allowed...)

SO, I'm wondering
- if it is worth to use ORM in my environment?
- can you mention any benefits?
- if so - what ORM you can recommend

What's your view?

like image 722
Maciej Avatar asked Jan 21 '26 04:01

Maciej


1 Answers

f it is worth to use ORM in my environment?

IMHO, probably not. ORMs focus on the object model and essentially try and treat the database as a dumb store or data. You probably have business logic contained in your stored procedures, which is somewhat counter to the general principles (or at least conventions).

In the very least you'll probably have manual mapping of your objects to and from the stored procedures.

like image 146
cletus Avatar answered Jan 23 '26 09:01

cletus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!