ORM

  • Thread starter Thread starter Marc
  • Start date Start date
M

Marc

The though of writing tons of Database code for a big project sends me to
sleep. I've used Java's EJB 3 and Hibernate about a year ago, for a very
small test project.

This time I'm considdering using nHibernate. It is however going to be a
very large multi-user system, with a local database cache, clients that
connect to this using remoting.
I am planning to make use of a quite complex table structure. I've read that
nHibernate doesn't scale well.

Has anyone used it for a large, real world system?

Marc
 
I can't answer your question about nHibernate. I just wanted to suggest that
you also look at Linq. Don't know if it will meet your needs either, but
more options is always good.

Andrew Faust
 
Andrew Faust said:
I can't answer your question about nHibernate. I just wanted to suggest that
you also look at Linq. Don't know if it will meet your needs either, but
more options is always good.

Not that the two are exclusive, of course. NHibernate has some LINQ
support already, and more is coming I believe.
 
Jon said:
Not that the two are exclusive, of course. NHibernate has some LINQ
support already, and more is coming I believe.

I wouldn't hold my breath for that.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
        I wouldn't hold my breath for that.

Can you clarify this, please? Why do you believe that, preferrably
backed by references and such?

Because, otherwise, considering your association with a directly
competing product, your blanket statement doesn't look very
convincing.
 
Many ORMs break down at scale. In general, it is ease of use versus scale. I
cannot answer to nHibernate.

One thing I would look at, if I were you, is LLBLGen Pro
(http://www.llblgen.com). It is at a good price for scale. Plus the author
lurks here, so you could end up getting questions answered by the person
responsible. LLBLGen has a much nicer data access than many of the other
ORMs out there and this is part of the reason it scales. It is the least
expensive (not cheapest) of the bunch. There is a demo version.

Deklarit is another option that scales (http://www.deklarit.com/). I have
never played with Deklarit personally, but they do have demos and samples on
their site.

Genome is another option that I have played with that is rather nice
(www.genom-e.com). I have played with genome, but have not deployed it with
a production product yet. I am more in maintenance mode right now, however,
so it may be some time before I do.

All three of these can be configured quite easily and each of them has
advanced features, if you need to go beyond the "out of the box" solution.

You can use any of them with LINQ, as Andrew has suggested. Genome has it
built in now, along with their own query language. I believe it is a plug in
with the other two. Frans will certainly correct me if I have misrepresented
LLBL Gen.

For the record, LINQ is not an ORM.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

********************************************
| Think outside the box! |
********************************************
 
For the record, LINQ is not an ORM.

LINQ in general isn't (but then "LINQ in general" is such a broad
thing that I often think it holds no real meaning at all). LINQ to
Entities, aka Entity Framework, most certainly is an ORM - but that
one is not released yet (should be a part of VS2008 SP1).
 
Hi Marc,
The though of writing tons of Database code for a big project sends me to
sleep. I've used Java's EJB 3 and Hibernate about a year ago, for a very
small test project.
This time I'm considdering using nHibernate. It is however going to be a
very large multi-user system, with a local database cache, clients that
connect to this using remoting.
I am planning to make use of a quite complex table structure. I've read that
nHibernate doesn't scale well.
Has anyone used it for a large, real world system?

You might want to have a look at the "Summer of NHibernate" series of
webcasts that Stephen Bohlen has been putting together. From what I
understand, the company he works for is using NHibernate on some very
real-life, very large projects...

http://www.summerofnhibernate.com

Cheers!
Marc
 
Pavel said:
Can you clarify this, please? Why do you believe that, preferrably
backed by references and such?

Because, otherwise, considering your association with a directly
competing product, your blanket statement doesn't look very
convincing.

Let's just say that I'm one of the few people on the planet who wrote a
fully functional linq provider for an o/r mapper, and looking at the
state of the nhibernate linq provider and the progress they're making,
it will take a long time before they're fully operational and be able to
do a lot of queries properly. that's not to say that the current version
isn't able to run a lot of queries, it's just that you will likely run
into a case where the provider will give up on you because the query
runs into an area that's not covered (yet)

The thing is though: it's unknown to the normal user which areas aren't
covered.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Jon said:
Well, NHibernate 2.0 went beta 1 at the end of June:

http://blog.domaindotnet.com/2008/06/29/nhibernate-20-goes-beta-1-
while-microsoft-linq-to-entities-receives-vote-of-no-confidence-from-
many-leading-net-experts-as-unacceptable/

2.0 doesn't contain a full linq provider. It's in the contrib lib.
As Pavel asked, do you have any evidence to suggest that people
shouldn't expect it to be released with LINQ support in a reasonable
timeframe?

See my reply to him.

You don't have to take my word for it, but don't be surprised that it
won't work properly either. I mean, it doesn't have support for
GroupJoin for example, which is something a tad more complex than from
where select stuff. Does it do group by's on join stacks? Group by's on
related entity data? etc. there are so many scenario's thinkable where
the expression tree looks a slightly bit different and you have to pull
essential information from another subtree than you'd expect (e.g. which
element in the join stack to target for the group by fields, thus
which alias to use? that's not really determinable from the groupby
method call in cases where the join is between the same entity so you
have to dig deeper)

The thing is that writing a linq provider which can handle *all*
queries you throw at it isn't a small thing. It took me 8 months of full
time development and often the material is very very complex simply
because there's little to no documentation and you practically work in
the dark. Add to that that the VB.NET compiler often creates trees which
look a tiny bit different, and you're in for a heck of a time ;).

As this linq provider moves forward very slowly, they've a lot of work
ahead of them. The downside of writing a linq provider is that you need
to work on it without interceptions, as processing the tree to create a
smaller, better to understand tree which then is reprocessed etc. is
something you can't do on an afternoon, you've to think things out,
design parts, implement them, test them, think through if you've covered
all the scenario's, because handling a given TYPE of subtree in a
general way means that it's handled EVERYWHERE by that routine due to
the visitor nature of the handlers, and you often want different results
for an expression in a projection than when it's in a where clause for
example, which means that the handler has to know the scope it's in,
which is more complex to make maintainable than it looks at first.

I'm sure readers of my previous post will think that I'm just playing
the marketing trumpet, but I just want to make clear what the real state
of reality is regarding linq providers of some o/r mappers, not just
Linq to nhibernate: just because they can consume a from where select
construct doesn't mean it supports linq in full, and that's a problem,
because the last thing you want is when writing a query that you can't
write it the way you want it because it's not supported by the provider.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Cowboy said:
Many ORMs break down at scale. In general, it is ease of use versus
scale. I cannot answer to nHibernate.

One thing I would look at, if I were you, is LLBLGen Pro
(http://www.llblgen.com). It is at a good price for scale. Plus the
author lurks here, so you could end up getting questions answered by the
person responsible. LLBLGen has a much nicer data access than many of
the other ORMs out there and this is part of the reason it scales. It is
the least expensive (not cheapest) of the bunch. There is a demo version.

Deklarit is another option that scales (http://www.deklarit.com/). I
have never played with Deklarit personally, but they do have demos and
samples on their site.

Genome is another option that I have played with that is rather nice
(www.genom-e.com). I have played with genome, but have not deployed it
with a production product yet. I am more in maintenance mode right now,
however, so it may be some time before I do.

All three of these can be configured quite easily and each of them has
advanced features, if you need to go beyond the "out of the box" solution.

You can use any of them with LINQ, as Andrew has suggested. Genome has
it built in now, along with their own query language. I believe it is a
plug in with the other two. Frans will certainly correct me if I have
misrepresented LLBL Gen.

It's part of the runtime now :) So you can use linq to write queries or
our native api if you want to. Obviously, targeting .net 2.0 or earlier
doesn't have linq available.

Btw, DeKlarit lost its lead developer to Infragistics some time ago.

FB


--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
I'm sure readers of my previous post will think that I'm just playing
the marketing trumpet, but I just want to make clear what the real state
of reality is regarding linq providers of some o/r mappers, not just
Linq to nhibernate: just because they can consume a from where select
construct doesn't mean it supports linq in full, and that's a problem,
because the last thing you want is when writing a query that you can't
write it the way you want it because it's not supported by the provider.

But that last point will *always* be the reality for LINQ providers,
IMO. There will always be unsupported scenarios. It's important that
those are documented, but just because not absolutely every possible
scenario is supported doesn't mean it shouldn't be considered a viable
alternative.
 
In its current incarnation, I find LINQ to be a great tool for iterating
through a set of objects rather than a data access layer replacement (which
I see a lot of) or an ORM. I do agree that LINQ to Entities offers ORM
capabilities, or rather the ability to use LINQ to iterate over entities,
although that is a bit too generic as well. :-)

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

********************************************
| Think outside the box! |
********************************************
For the record, LINQ is not an ORM.

LINQ in general isn't (but then "LINQ in general" is such a broad
thing that I often think it holds no real meaning at all). LINQ to
Entities, aka Entity Framework, most certainly is an ORM - but that
one is not released yet (should be a part of VS2008 SP1).
 
Jon said:
But that last point will *always* be the reality for LINQ providers,
IMO. There will always be unsupported scenarios. It's important that
those are documented, but just because not absolutely every possible
scenario is supported doesn't mean it shouldn't be considered a viable
alternative.

True that there are always scenario's which won't be covered. It's
indeed a matter of documentating what is and isn't covered. There are
various O/R mappers out there who claim to have Linq support while they
don't even have the basics covered, but that's not documented. (I'm not
talking about linq to nhibernate which is still in development).

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Marc said:
The though of writing tons of Database code for a big project sends me to
sleep. I've used Java's EJB 3 and Hibernate about a year ago, for a very
small test project.

This time I'm considdering using nHibernate. It is however going to be a
very large multi-user system, with a local database cache, clients that
connect to this using remoting.
I am planning to make use of a quite complex table structure. I've read
that nHibernate doesn't scale well.

Thanks guys for all the suggestions. LINQ looks favorable, plus it's a
Microsoft solution - where possible it's nice to have it built into the
language I find. At least we can control how data is cached on the client
here.
Although LINQ is not really ORM, rather a way of accessing data in objects -
so we might develop a base class that can reflect and find out it's
properties, and persist that way (obviously with some caching, again
performance might be an issue here)
Gets a bit more complex when you want one to many relations mapped as a
collection I guess.
Will also take a look at the 3rd perty solutions suggested by Cowboy.

Thanks again,

Marc
 
Marc said:
Thanks guys for all the suggestions. LINQ looks favorable, plus it's a
Microsoft solution - where possible it's nice to have it built into the
language I find. At least we can control how data is cached on the client
here.
Although LINQ is not really ORM, rather a way of accessing data in objects -
so we might develop a base class that can reflect and find out it's
properties, and persist that way (obviously with some caching, again
performance might be an issue here)
Gets a bit more complex when you want one to many relations mapped as a
collection I guess.

"LINQ" is not one particular thing - it's a collection of technologies,
really. It sounds like you're thinking of LINQ to Objects. LINQ to SQL
and the Entity Framework (which uses LINQ) are both ORMs, of varying
degrees of power.
 
Back
Top