Click here to Skip to main content
14,456,590 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralRe: To ORM or not to ORM Pin
Jörgen Andersson7-Mar-18 9:51
communityengineerJörgen Andersson7-Mar-18 9:51 
GeneralRe: To ORM or not to ORM Pin
RickZeeland7-Mar-18 10:03
communityengineerRickZeeland7-Mar-18 10:03 
GeneralRe: To ORM or not to ORM Pin
Jörgen Andersson7-Mar-18 10:10
communityengineerJörgen Andersson7-Mar-18 10:10 
PraiseRe: To ORM or not to ORM Pin
RickZeeland7-Mar-18 10:15
communityengineerRickZeeland7-Mar-18 10:15 
GeneralRe: To ORM or not to ORM Pin
Jörgen Andersson7-Mar-18 10:22
communityengineerJörgen Andersson7-Mar-18 10:22 
GeneralRe: To ORM or not to ORM Pin
abmv6-Mar-18 1:18
professionalabmv6-Mar-18 1:18 
AnswerRe: To ORM or not to ORM Pin
HobbyProggy5-Mar-18 21:41
professionalHobbyProggy5-Mar-18 21:41 
AnswerRe: To ORM or not to ORM Pin
theokr5-Mar-18 22:31
Membertheokr5-Mar-18 22:31 
As is often the case, there are reasons for and against using an ORM. Sadly, there are many extremists in both camps. I've worked on projects which do with and without ORMs.

Examples of reasons for (not exhaustive):
1. Avoid hardcoding SQL in your OO code
2. Makes unit testing easy in. Net
3. Repository out of the box
4. Can be very quick to setup

Examples of reasons against (not exhaustive):
1. Lots of business logic in the database layer
2. Difficult performance targets
3. Limited system resources (memory)
4. Tiny database - not worth the overhead

Then the question becomes which ORM.

Nhibernate comes from the Java world so you'd automatically be weary however, used right, it's fine. As someone on here already mentioned, you can still write direct SQL and call sprocs using it and just use nhibernate as the wrapper.

EF wasn't great in it's infancy and didn't play too well/at a with non-SQL servers but it's a big boy now and is much better. I'd use it over nhibernate if you can get the drivers for the database.

To ORM or not to ORM is not the question. The question is whether it's right for your project or more specifically, if it's right for your database/app model.

To rebut what someone said earlier, I'd argue that you should have a good knowledge of writing SQL and investigating performance whichever route you go.

I will not however that what you hit a problem with an ORM, particularly nhibernate which I've used in the past, you could be stuck for ages as the docs aren't great and there used to be lots of bugs but to be honest, this shouldn't happen so much nowadays unless you're trying to get super fancy. Still I haven't used nhibernate for 5 years.

Good luck
PraiseRe: To ORM or not to ORM Pin
RickZeeland6-Mar-18 1:50
communityengineerRickZeeland6-Mar-18 1:50 
AnswerRe: To ORM or not to ORM Pin
F-ES Sitecore5-Mar-18 23:48
mveF-ES Sitecore5-Mar-18 23:48 
AnswerRe: To ORM or not to ORM Pin
Fabio Franco6-Mar-18 0:16
professionalFabio Franco6-Mar-18 0:16 
AnswerRe: To ORM or not to ORM Pin
Member 133016796-Mar-18 3:06
MemberMember 133016796-Mar-18 3:06 
AnswerRe: To ORM or not to ORM Pin
W Balboos6-Mar-18 3:28
mveW Balboos6-Mar-18 3:28 
GeneralRe: To ORM or not to ORM Pin
RickZeeland6-Mar-18 3:47
communityengineerRickZeeland6-Mar-18 3:47 
AnswerRe: To ORM or not to ORM Pin
Steve Naidamast6-Mar-18 3:56
professionalSteve Naidamast6-Mar-18 3:56 
AnswerRe: To ORM or not to ORM Pin
fqborges6-Mar-18 3:58
Memberfqborges6-Mar-18 3:58 
AnswerRe: To ORM or not to ORM Pin
DetroitJ6-Mar-18 4:08
MemberDetroitJ6-Mar-18 4:08 
AnswerRe: To ORM or not to ORM Pin
Tim L. Holgerson6-Mar-18 4:26
MemberTim L. Holgerson6-Mar-18 4:26 
AnswerRe: To ORM or not to ORM Pin
Jaime Premy6-Mar-18 6:00
professionalJaime Premy6-Mar-18 6:00 
AnswerRe: To ORM or not to ORM Pin
EbenRoux6-Mar-18 6:34
MemberEbenRoux6-Mar-18 6:34 
AnswerRe: To ORM or not to ORM Pin
Gerry Schmitz6-Mar-18 11:00
mveGerry Schmitz6-Mar-18 11:00 
AnswerRe: To ORM or not to ORM Pin
Marc Greiner at home7-Mar-18 1:01
MemberMarc Greiner at home7-Mar-18 1:01 
AnswerRe: To ORM or not to ORM Pin
MadMyche7-Mar-18 6:55
mveMadMyche7-Mar-18 6:55 
GeneralRe: To ORM or not to ORM Pin
RickZeeland7-Mar-18 7:05
communityengineerRickZeeland7-Mar-18 7:05 
AnswerRe: To ORM or not to ORM Pin
Eric Whitmore7-Mar-18 17:36
MemberEric Whitmore7-Mar-18 17:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.