Click here to Skip to main content
15,789,698 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
I have worked in a project where most of the business logic was in Stored Procedures (SQL 2005). So we just used to call the stored procedure from Data Access Layer.
I am very new to this ORM concept. Have a fair understanding of it. I have gone through Entity Framework Model, NHibernate, but could not understand the situation where we can make use of them.

Can you please suggest me a practical example, where we can effectively use these ORM tools....
Updated 30-Apr-18 18:57pm
Espen Harlinn 18-Jan-11 8:32am    
The ORM vs other alternatives is a pretyy hard question to answer. You can often accellerate the development process, but you pay in terms of performance - just my 2ct's

The best time to use an ORM is:

0) When you don't care how badly a program performs

1) You're willing to give up a certain amount of flexibility

2) You know for sure and certain that there's no way on this earth that you're going to need to modify the generated code.
Share this answer
Pravin Patil, Mumbai 18-Jan-11 9:02am    
Thanks a lot.
Espen Harlinn 18-Jan-11 9:12am    
5+ Good answer
Pravin Patil, Mumbai 18-Jan-11 9:24am    
Yeah.....Just three lines and need of ORM explained....
Espen Harlinn 18-Jan-11 9:30am    
Actually, I do use ORM tools, but not for anything performance critical, and I would certainly not replace existing, well functioning code with an ORM.
Pravin Patil, Mumbai 18-Jan-11 9:34am    
Which ORM tool you use the most, and which one you find the best...?
You are looking for a problem to fix with a solution already decided!? Yes, of course you are, because you want to learn how the damn thing is used practically - this is a commendable idea, but sadly missed by many.

Here are a few guidelines:

1. Does the application you write need to be database agnostic?
2. Are you developing a product that needs to support different databases?

In general, where a DB schema remains *almost* constant, an O/R mapper may provide some gains for DB structure to Object serialization and vice versa.

This does not mean that solution for all of the above is O/R M tool, but simply that O/R M tools are appropriate to be evaluated in these scenarios.

Be aware that many similar situations can also be addressed through a well written DAL.

If you have understood the theory and keep your mind open when designing solutions for new projects, you may see some good uses for O/R M.
Share this answer
Pravin Patil, Mumbai 18-Jan-11 9:02am    
Thank you very much sir for your quick reply.
shreekar 18-Jan-11 9:06am    
Please drop the sir. It is a title bestowed by the England Queen and may not be much relevant even in UK itself today.
Pravin Patil, Mumbai 18-Jan-11 9:07am    
Thank you very much shreekar........
#realJSOP 18-Jan-11 9:09am    
It's also a sign of respect within the general population, as in "Yes sir.", "Thank you, sir", or "Would you like fires with your hamburger, sir?"

shreekar 18-Jan-11 9:17am    
Agreed. But in context of posting comments to unknown people, seems weird and sometimes, when overdone, also seems facetious.
Or maybe it is just my post colonial hangover...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900