NHibernate (yes or no)

F

Fabiano

Please,

i would like to know if there's a good idea use NHibernate
(http://nhibernate.sourceforge.net/) at my programs besides native data tier
of .NET.

Java mans love it very much, but i don't know if its going to be a nice way
in .NET

You guys, what think about?

Tks in adv
Fabiano
 
M

Miha Markic [MVP C#]

Sahil,

NHibernate is an ORM while prevayler is something totaly different.
I personally don't like or use ORMs so I can't comment whether NHibernat is
good or not.
 
R

Rafal Gwizdala

Hello,

Miha, can I ask you a question? It is a survey :)
Why do you prefer not to use ORM tools, and what do you use instead (what
tools/methods do you use for creating data access layer and business logic
layer)?

And in the topic of using / not using NHibernate (to answer Fabiano's
question)

I think ORM is a must have if you are designing N-tier transaction
processing software. My experience is that good ORM helps produce smaller,
cleaner code, and it is much easier to port the application to other RDBMS
or to reuse its components. It also helps in creating clear, layered system
architectures.
Simple example: with ORM you get unified way of accessing your application's
data, so you can build reusable GUI components that closely cooperate with
the ORM tool.
My favourite ORM for .Net is Sooda (www.sooda.org), haven't experimented too
much with other tools.

Best Regards
RG


Miha Markic said:
Sahil,

NHibernate is an ORM while prevayler is something totaly different.
I personally don't like or use ORMs so I can't comment whether NHibernat
is good or not.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

Sahil Malik said:
Is that something similar to Prevayler? If so, my vote is "It's doodoo, I
don't like it !!"

More views -
http://www.codebetter.com/blogs/sahil.malik/search.aspx?q=prevayler&p=1


- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/
 
M

Miha Markic [MVP C#]

Hi Rafal,

Rafal Gwizdala said:
Hello,

Miha, can I ask you a question? It is a survey :)

I hope that you are giving prizes away.
Why do you prefer not to use ORM tools, and what do you use instead (what
tools/methods do you use for creating data access layer and business logic
layer)?

For now, I am an ado.net fan. However, I use CodeSmith to create much of the
code necessary.
http://www.ericjsmith.net/codesmith/
And I am pretty sure that no ORM can beat this combination - both in speed
and flexibility.
Note, that you can create an ORM layer with CodeSmith also - actually, the
code would be better than any ORM layer out there (it really depends on your
templates used for code generation) since you have complete control and
database metadata handy.
And in the topic of using / not using NHibernate (to answer Fabiano's
question)

I think ORM is a must have if you are designing N-tier transaction
processing software.

It doesn't matter if you use ORM or just plain ado.net.

My experience is that good ORM helps produce smaller,
cleaner code, and it is much easier to port the application to other RDBMS
or to reuse its components. It also helps in creating clear, layered
system architectures.

IMO it has nothing to do with tiers. ado.net is perfectly suitable for
n-tier aplications.
But the bigest disadvantage of an ORM is flexibility IMO - you really can't
match pure ado.net.
Simple example: with ORM you get unified way of accessing your
application's data, so you can build reusable GUI components that closely
cooperate with the ORM tool.

Again, all of this can be achieved using ado.net.
This is a good topic for an eternal thread :)
 
F

Frans Bouma [C# MVP]

Miha said:
For now, I am an ado.net fan. However, I use CodeSmith to create much of the
code necessary.
http://www.ericjsmith.net/codesmith/
And I am pretty sure that no ORM can beat this combination - both in speed
and flexibility.

Bite me :)
You bet I can beat that combination. LLBLGen Pro's code generator
engine is more flexible and has a powerful set of SQL engines to talk
to. Where's that in your codesmith setup?
Note, that you can create an ORM layer with CodeSmith also - actually, the
code would be better than any ORM layer out there (it really depends on your
templates used for code generation) since you have complete control and
database metadata handy.

yeah right :). Writing an O/R mapper layer is very hard work, and
you're going to generate that code with a couple of templates? I don't
think so. For starters: you lack the dynamic query engine which produces
SQL on the fly using meta-data.
IMO it has nothing to do with tiers. ado.net is perfectly suitable for
n-tier aplications.
But the bigest disadvantage of an ORM is flexibility IMO - you really can't
match pure ado.net.

ADO.NET is just a helper-layer to work with an RDBMS. And it's very low
level. In 99% of the occasions you can perfectly work with a layer
produced by an O/R mapper. A good O/R mapper isn't giving in to
flexibility, on the contrary: the O/R mapper lets you focus on what's
really important instead of writing plumbing code.

And because you're using codesmith, please tell me where you get your
hands dirty to write low level ado.net to squeese out the flexibility
you apparently need? I don't see it, as you use code generation without
a meta-data consuming sql engine. If that's not giving up on flexibility
I don't know what is ;)
Again, all of this can be achieved using ado.net.

You can? Hmm. Ever tried to write generic code which targets sqlserver
2000 and oracle ? If you have, you'll know that if you just have
ADO.NET, it's a tough job, or you have to write hundreds and hundreds of
sqlserver procedures and hundreds and hundreds of oracle procedures.
Also a lot of work.

Tell me, is that flexibility of yours really a gain? ;)

FB

--
 
M

Miha Markic [MVP C#]

....
You can? Hmm. Ever tried to write generic code which targets sqlserver
2000 and oracle ? If you have, you'll know that if you just have ADO.NET,
it's a tough job, or you have to write hundreds and hundreds of sqlserver
procedures and hundreds and hundreds of oracle procedures. Also a lot of
work.

Tell me, is that flexibility of yours really a gain? ;)

Yes. ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top