Click here to Skip to main content
15,896,278 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 8:51
professionalJörgen Andersson7-Mar-18 8:51 
GeneralRe: To ORM or not to ORM Pin
RickZeeland7-Mar-18 9:03
mveRickZeeland7-Mar-18 9:03 
GeneralRe: To ORM or not to ORM Pin
Jörgen Andersson7-Mar-18 9:10
professionalJörgen Andersson7-Mar-18 9:10 
PraiseRe: To ORM or not to ORM Pin
RickZeeland7-Mar-18 9:15
mveRickZeeland7-Mar-18 9:15 
GeneralRe: To ORM or not to ORM Pin
Jörgen Andersson7-Mar-18 9:22
professionalJörgen Andersson7-Mar-18 9:22 
GeneralRe: To ORM or not to ORM Pin
abmv6-Mar-18 0:18
professionalabmv6-Mar-18 0:18 
AnswerRe: To ORM or not to ORM Pin
HobbyProggy5-Mar-18 20:41
professionalHobbyProggy5-Mar-18 20:41 
AnswerRe: To ORM or not to ORM Pin
theokr5-Mar-18 21:31
theokr5-Mar-18 21: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 0:50
mveRickZeeland6-Mar-18 0:50 
AnswerRe: To ORM or not to ORM Pin
F-ES Sitecore5-Mar-18 22:48
professionalF-ES Sitecore5-Mar-18 22:48 
AnswerRe: To ORM or not to ORM Pin
Fabio Franco5-Mar-18 23:16
professionalFabio Franco5-Mar-18 23:16 
AnswerRe: To ORM or not to ORM Pin
Member 133016796-Mar-18 2:06
Member 133016796-Mar-18 2:06 
AnswerRe: To ORM or not to ORM Pin
W Balboos, GHB6-Mar-18 2:28
W Balboos, GHB6-Mar-18 2:28 
GeneralRe: To ORM or not to ORM Pin
RickZeeland6-Mar-18 2:47
mveRickZeeland6-Mar-18 2:47 
AnswerRe: To ORM or not to ORM Pin
Steve Naidamast6-Mar-18 2:56
professionalSteve Naidamast6-Mar-18 2:56 
AnswerRe: To ORM or not to ORM Pin
fqborges6-Mar-18 2:58
fqborges6-Mar-18 2:58 
AnswerRe: To ORM or not to ORM Pin
DetroitJ6-Mar-18 3:08
DetroitJ6-Mar-18 3:08 
AnswerRe: To ORM or not to ORM Pin
Tim L. Holgerson6-Mar-18 3:26
Tim L. Holgerson6-Mar-18 3:26 
AnswerRe: To ORM or not to ORM Pin
Jaime Premy6-Mar-18 5:00
professionalJaime Premy6-Mar-18 5:00 
AnswerRe: To ORM or not to ORM Pin
EbenRoux6-Mar-18 5:34
EbenRoux6-Mar-18 5:34 
AnswerRe: To ORM or not to ORM Pin
Gerry Schmitz6-Mar-18 10:00
mveGerry Schmitz6-Mar-18 10:00 
AnswerRe: To ORM or not to ORM Pin
Marc Greiner at home7-Mar-18 0:01
Marc Greiner at home7-Mar-18 0:01 
AnswerRe: To ORM or not to ORM Pin
MadMyche7-Mar-18 5:55
professionalMadMyche7-Mar-18 5:55 
GeneralRe: To ORM or not to ORM Pin
RickZeeland7-Mar-18 6:05
mveRickZeeland7-Mar-18 6:05 
AnswerRe: To ORM or not to ORM Pin
Eric Whitmore7-Mar-18 16:36
Eric Whitmore7-Mar-18 16: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.