My company is currently evaluating O/R Mappers (again.) The two that interest me the most are NHibernate and Paul Wilson's. Paul, I know what your vote will be so you don't count. :)
We're currently using CSLA with custom codesmith templates but it is pretty slow going and error prone. There's a LOT I don't like about CSLA. We have recently looked at IdeaBlade but it does NOT support identity columns which is a problem for existing databases
and very non-intuitive at the DB level. Also there is no inheritance or collection support. Another one we've used on a project is LLBLGen Pro. LLBLGen was ok until we found a bug where if you access a property, and the record represented by the property
does not exist in the database, LLBLGen instantiates a new object for you in the object model. However, when you go to save, it actually tries to save this new, "Blank" object as a record, which then throws a very obscure error later on. This happens constantly
with LLBLGen and is really annoying. LLBLGen actually did do a lot for you, however it was complicated to use, did not store the mappings in a XML or otherwise human readable file (which made comparison in source control impossible as well as copying and
pasting mappings from one file to another impossible) and did not support inheritance. Finally, we are also looking at NetTiers, which is a codesmith template. However, the newest version uses Enterprise Library, which throws xcopy deployment out the window.
It also does not support inheritance straight out the box although you can modify the templates mabye.
So in summary, we're looking for an O/R Mapper that supports the following:
-Inheritance (Amazing how many do not do this!)
-XML mapping/configuration file
-Preferably open source (or the ability to purchase the source code)
-Writes most SQL for us (preferably thru strongly typed queries)
-Ability to write custom sql if necessary
-Would prefer the ability to generate both business objects AND collections.
As far as Paul Wilson's and NHibernate, they seem to support most of this. Has anyone used any of these in an enterprise level, production app? I'm not taling a proof of concept or demo app, but a real production web or windows application that is currently
in use. If you have, what were your experiences like? How much time did they save? How many other problems did they cause?
Finally, has anyone successfully used any other OR Mappers that support these features?
We are in the process of writing several production applications that use XPO from DevExpress. It supports all of your listed requirements with perhaps that it doesn't currently generate classes from an existing database. However, there are plenty of other
tools that can do just this. We've had good success with XPO so far. It has been extendable whenever we have a requirement that isn't built in directly. It is an intrusive mapper, though, meaning your must inherit from a base class or implement an interface,
but many other mappers are likewise. I would also suggest checking out Versant's mapper as I've heard good things about it, though I've never used it...
We are in the process of writing several production applications that use XPO from DevExpress. It supports all of your listed requirements with perhaps that it doesn't currently generate classes from an existing database. However, there are plenty of other
tools that can do just this. We've had good success with XPO so far. It has been extendable whenever we have a requirement that isn't built in directly. It is an intrusive mapper, though, meaning your must inherit from a base class or implement an interface,
but many other mappers are likewise. I would also suggest checking out Versant's mapper as I've heard good things about it, though I've never used it...
I had heard of Versant but haven't looked into it yet. Does anyone know if Versant is expensive?
XPO looks nice. Do you find a lot of productivity increase? Are there any issues surrounding it? Have you run into any development problems or performance bottlenecks?
I've used NHibernate a number of times and am quite pleased with it. However, the difference between an O/R mapping framework (like NHibernate) and code generation tools (like CodeSmith) is exactly where your list of requirements hits a bump. O/R mapping frameworks
do not generate code, and therefore will not "generate both business objects AND collections". Also the "ability to write custom sql" is more interesting in terms of what use case it which it will be involved than how to do it in a specific tool. Reporting
is a common case that brings out that kind of requirement. But, reporting does not need to run on an O/R mapping framework. Hell, it isn't even object oriented.
Why do you need to find a single tool to do everything? Use CodeSmith for code generation. Use an O/R mapping tool for Domain Model persistence (or more). For reporting do something else. Most of the problems I find in projects where 3rd party components are
used is that the developers try to do absolutely EVERYTHING within the boundaries of the product. There really is only one tool that COULD be flexible enough to handle anything, and that tool is Visual Studio.
Thanks,
Udi Dahan - The Software Simplist
Enterprise Development Expert & SOA Specialist
We haven't done a lot of complicated ASP.NET apps with it. We've primarily used WinForms to this point. I have heard several people say that there's a few items you must keep in mind when designing Web vs. Win forms using XPO. We have experienced what I would
characterize as a very nice/large productivity increase in addition to an increase in accuracy. I don't have absolute "numbers" to back up our productivity, but I can say that our projects would have taken a LOT longer, been harder to develop and been more
likely to have errors if we had tried to write our own mapper.
We had a few "exotic" requirements (I would say) such as no true deletes (we use a type of inactivation), a legacy database with a sub-optimal level of normalization, several layers of inheritance (in our objects and tables), etc. XPO seemed to handle most
of the issues fine, through either extending their base persistent classes or other extensions. Additionally, we hit a problem where a weird exception was being thrown (object was modified exception...) during a for...each but no apparent updates were being
done. We were able to get around it by modifying the XPO source code to use a real for(...) instead and have seen no side effects (again we could find no evidence of a modification being done).
As far as downsides, I'm not in love with their Session object as it can be cumbersome to use at times. I would also prefer a mapper that is not intrusive. However, when we evaluated XPO over a year ago it was our favorite mapper (many features, reasonable
price, etc) on the market then and it has served us well since. DevExpress has decent newsgroups and their email support has also been excellent. I would recommend at least evaluating it and comparing it to the ones you mentioned.
I've used NHibernate a number of times and am quite pleased with it. However, the difference between an O/R mapping framework (like NHibernate) and code generation tools (like CodeSmith) is exactly where your list of requirements hits a bump. O/R mapping frameworks
do not generate code, and therefore will not "generate both business objects AND collections". Also the "ability to write custom sql" is more interesting in terms of what use case it which it will be involved than how to do it in a specific tool. Reporting
is a common case that brings out that kind of requirement. But, reporting does not need to run on an O/R mapping framework. Hell, it isn't even object oriented.
Why do you need to find a single tool to do everything? Use CodeSmith for code generation. Use an O/R mapping tool for Domain Model persistence (or more). For reporting do something else. Most of the problems I find in projects where 3rd party components are
used is that the developers try to do absolutely EVERYTHING within the boundaries of the product. There really is only one tool that COULD be flexible enough to handle anything, and that tool is Visual Studio.
Well, the code generation is really optional. I'd like to have it all wrapped up in one neat product, but that isn't necessary. WORM and NHibernate both seem like frameworks, and both code benefit from some codesmith. However, there ARE O/R Mappers that create
the business objects out there as well.
I agree about the reporting and such. The right tool for the right job. However, it does get silly at times if developers have 5 different ways for data access, depending on what they are doing. If one tool will "do it all" that would be ideal. Many O/R
Mappers do try to tackle reporting by giving the option of returning datasets or some sort of collection that contains multiple business object types. How well this work...I'm not sure.
Also the "ability to write custom sql" is more interesting in terms of what use case it which it will be involved than how to do it in a specific tool.
We have had to use custom SQL queries in our domain model/DAL (used via our O/R Mapper) in certain cases where our database does silly things that cannot be changed due to other applications using the database. One such situation with XPO was to get a
query of people who are subscribed to a mailing list. The problem is that the mailing list subscriptions are stored as bits in a long within the database so you have to do bitwise operations. (At present) XPO does not have a query mechanism to generate bitwise
compares in SQL so we had to write this sql and then execute it using XPO. It actually worked out fine - though I do agree it is a bit of a hack... However, as you mention this should definitely be the exception rather than the rule for needing custom sql...
WORM definitely gets my vote. We have used it in multiple enterprise apps and a couple of websites (all of which are still running just fine with no hint of issues from use of the maper) and it is just so easy and quick to use. It does everything that you
ask for. So does NHibernate, but the reason that we use WORM and not NHibernate is that NHibernate is just that little bit more complex that would make it less useable for us when compared to WORM.
Versant, aaahhhh, Versant. Brilliant products from that company (FastObjects just blew me away) and VOA.NET really captured my attention, but, alas, duing our testing of it we hit nothing but problems. Strange undocumented exceptions and a very unintuitive
approach to developing with the product (this could probably be overcome by experience though). I am absolutely positive that, in time, this will be a GREAT product. But not right now. It needs more testing and user feedback.
fregas
Member
406 Points
96 Posts
WORM, NHibernate and reviews of any other ORMappers
Jul 19, 2005 03:27 PM|LINK
Hello all.
My company is currently evaluating O/R Mappers (again.) The two that interest me the most are NHibernate and Paul Wilson's. Paul, I know what your vote will be so you don't count. :)
We're currently using CSLA with custom codesmith templates but it is pretty slow going and error prone. There's a LOT I don't like about CSLA. We have recently looked at IdeaBlade but it does NOT support identity columns which is a problem for existing databases and very non-intuitive at the DB level. Also there is no inheritance or collection support. Another one we've used on a project is LLBLGen Pro. LLBLGen was ok until we found a bug where if you access a property, and the record represented by the property does not exist in the database, LLBLGen instantiates a new object for you in the object model. However, when you go to save, it actually tries to save this new, "Blank" object as a record, which then throws a very obscure error later on. This happens constantly with LLBLGen and is really annoying. LLBLGen actually did do a lot for you, however it was complicated to use, did not store the mappings in a XML or otherwise human readable file (which made comparison in source control impossible as well as copying and pasting mappings from one file to another impossible) and did not support inheritance. Finally, we are also looking at NetTiers, which is a codesmith template. However, the newest version uses Enterprise Library, which throws xcopy deployment out the window. It also does not support inheritance straight out the box although you can modify the templates mabye.
So in summary, we're looking for an O/R Mapper that supports the following:
-Inheritance (Amazing how many do not do this!)
-XML mapping/configuration file
-Preferably open source (or the ability to purchase the source code)
-Writes most SQL for us (preferably thru strongly typed queries)
-Ability to write custom sql if necessary
-Would prefer the ability to generate both business objects AND collections.
As far as Paul Wilson's and NHibernate, they seem to support most of this. Has anyone used any of these in an enterprise level, production app? I'm not taling a proof of concept or demo app, but a real production web or windows application that is currently in use. If you have, what were your experiences like? How much time did they save? How many other problems did they cause?
Finally, has anyone successfully used any other OR Mappers that support these features?
(Thona need not apply.)
Thanks,
Fregas
rsmoke21
Contributor
3931 Points
792 Posts
Re: WORM, NHibernate and reviews of any other ORMappers
Jul 19, 2005 04:49 PM|LINK
ScAndal
Participant
1304 Points
290 Posts
Re: WORM, NHibernate and reviews of any other ORMappers
Jul 19, 2005 07:03 PM|LINK
K.I.S.S.
ScAndal
.NET Consulting http://www.kineticmedia.net
fregas
Member
406 Points
96 Posts
Re: WORM, NHibernate and reviews of any other ORMappers
Jul 19, 2005 07:12 PM|LINK
I had heard of Versant but haven't looked into it yet. Does anyone know if Versant is expensive?
XPO looks nice. Do you find a lot of productivity increase? Are there any issues surrounding it? Have you run into any development problems or performance bottlenecks?
Fregas
UdiDahan
Member
114 Points
22 Posts
Re: WORM, NHibernate and reviews of any other ORMappers
Jul 19, 2005 07:50 PM|LINK
Why do you need to find a single tool to do everything? Use CodeSmith for code generation. Use an O/R mapping tool for Domain Model persistence (or more). For reporting do something else. Most of the problems I find in projects where 3rd party components are used is that the developers try to do absolutely EVERYTHING within the boundaries of the product. There really is only one tool that COULD be flexible enough to handle anything, and that tool is Visual Studio.
Udi Dahan - The Software Simplist
Enterprise Development Expert & SOA Specialist
JayC202
Member
725 Points
145 Posts
Re: WORM, NHibernate and reviews of any other ORMappers
Jul 19, 2005 08:07 PM|LINK
rsmoke21
Contributor
3931 Points
792 Posts
Re: WORM, NHibernate and reviews of any other ORMappers
Jul 19, 2005 08:36 PM|LINK
We had a few "exotic" requirements (I would say) such as no true deletes (we use a type of inactivation), a legacy database with a sub-optimal level of normalization, several layers of inheritance (in our objects and tables), etc. XPO seemed to handle most of the issues fine, through either extending their base persistent classes or other extensions. Additionally, we hit a problem where a weird exception was being thrown (object was modified exception...) during a for...each but no apparent updates were being done. We were able to get around it by modifying the XPO source code to use a real for(...) instead and have seen no side effects (again we could find no evidence of a modification being done).
As far as downsides, I'm not in love with their Session object as it can be cumbersome to use at times. I would also prefer a mapper that is not intrusive. However, when we evaluated XPO over a year ago it was our favorite mapper (many features, reasonable price, etc) on the market then and it has served us well since. DevExpress has decent newsgroups and their email support has also been excellent. I would recommend at least evaluating it and comparing it to the ones you mentioned.
fregas
Member
406 Points
96 Posts
Re: WORM, NHibernate and reviews of any other ORMappers
Jul 19, 2005 10:00 PM|LINK
Well, the code generation is really optional. I'd like to have it all wrapped up in one neat product, but that isn't necessary. WORM and NHibernate both seem like frameworks, and both code benefit from some codesmith. However, there ARE O/R Mappers that create the business objects out there as well.
I agree about the reporting and such. The right tool for the right job. However, it does get silly at times if developers have 5 different ways for data access, depending on what they are doing. If one tool will "do it all" that would be ideal. Many O/R Mappers do try to tackle reporting by giving the option of returning datasets or some sort of collection that contains multiple business object types. How well this work...I'm not sure.
rsmoke21
Contributor
3931 Points
792 Posts
Re: WORM, NHibernate and reviews of any other ORMappers
Jul 20, 2005 12:40 PM|LINK
We have had to use custom SQL queries in our domain model/DAL (used via our O/R Mapper) in certain cases where our database does silly things that cannot be changed due to other applications using the database. One such situation with XPO was to get a query of people who are subscribed to a mailing list. The problem is that the mailing list subscriptions are stored as bits in a long within the database so you have to do bitwise operations. (At present) XPO does not have a query mechanism to generate bitwise compares in SQL so we had to write this sql and then execute it using XPO. It actually worked out fine - though I do agree it is a bit of a hack... However, as you mention this should definitely be the exception rather than the rule for needing custom sql...
sroughley
Participant
1404 Points
381 Posts
Re: WORM, NHibernate and reviews of any other ORMappers
Jul 20, 2005 01:52 PM|LINK
WORM definitely gets my vote. We have used it in multiple enterprise apps and a couple of websites (all of which are still running just fine with no hint of issues from use of the maper) and it is just so easy and quick to use. It does everything that you ask for. So does NHibernate, but the reason that we use WORM and not NHibernate is that NHibernate is just that little bit more complex that would make it less useable for us when compared to WORM.
Versant, aaahhhh, Versant. Brilliant products from that company (FastObjects just blew me away) and VOA.NET really captured my attention, but, alas, duing our testing of it we hit nothing but problems. Strange undocumented exceptions and a very unintuitive approach to developing with the product (this could probably be overcome by experience though). I am absolutely positive that, in time, this will be a GREAT product. But not right now. It needs more testing and user feedback.