NOTE: Read about our Current Status
Decision Points for Selecting an O/R Mapping Tool for .NET
With the number of O/R Mapping components on the market already, just the work it takes to find all the available choices can take an entire day. That's before you take the time to actually evaluate each product. Below is a list of decision points that you might want to keep in mind as you look at what each product has to offer.
- Try Before You Buy
- Version Support
- Source Code
- Mapping Configuration Tools
- Caching Support
- Object-Oriented Query Language
- Object Model Support
Naturally, not all of these factors apply to every application.
Try Before You Buy
The first thing to keep in mind is that no matter how much information we pack into this Guide, there's no substitute for trying the software in your own environment and on your own application. No one knows your own requirements, or the quirks of your own tools and components, better than you do. Fortunately, just about every vendor in the .NET tools and components business provides a trial version of their software for free evaluation. We recommend that you use this Guide to locate the O/R Mapping components that seem like a good fit for your application, and then download copies to evaluate them in your own environment. With O/R Mapping components, you'll find that evaluation copies normally display a nag dialog when certain features are accessed or are limited editions that do not contain some of the more advanced features that come when you purchase a licensed copy. This is not enough to interfere with evaluation, but generally precludes you from using an evaluation copy in a commercial application. Of course, you should follow the licensing requirements scrupulously in any case.
Trying before buying with O/R Mapping components is most important so that you can get a feel for the feature set of the component, how easy the API is to work with, and how well supported the component is with help files, documentation, source code examples, and design-time support. Some O/R Mapper vendors are happy to provide clients with free e-mail support during their evaluation period, while others may refer you to a knowledge base or forum for peer support. Some vendors also have How-To listings on their Web sites so that you can review code samples showing how to use their product in your application.
Version Support
As of mid-2005, you might be working with .NET 1.0, .NET 1.1, a beta version of .NET 2.0, the .NET Compact Framework, or the Mono implementation of the .NET Common Language Runtime (a cross-platform open source implementation available for Windows and Linux). Although some O/R Mapper components are compatible in any of these environments, others have limitations such as using libraries not included with the .NET Compact Framework or not yet being compatible with new features in .NET 2.0. You'll need to verify that your vendor can match all of your target environments, or that they have a plan for doing so before your planned ship date.
Source Code
Obviously, open source vendors allow you to access the source code behind their products. Surprisingly, so do some of the vendors that do not give away their product for free. Although some vendors charge extra or require special agreements to send you the source code, some will freely provide it with the product. This may be important to you if you require the ability to fix bugs or add features without relying on the vendor or if you'd like to be able to point the vendor to the problematic source code when you report it in order to get your support request resolved more quickly.
Mapping Configuration Tools
Some of the O/R Mapper components we reviewed made use of external XML mapping files that can become very lengthy depending on the number of entities you have in your system. Managing these files is simplified greatly if the vendor provides a utility for configuring them.
Caching Support
For applications accessing data that does not change frequently or only needs read-only access, caching can play an important role. Different methods of caching can be employed among O/R Mappers like a disk-based cache or in-memory. Additionally, some O/R Mappers can cache the object-relational mapping information in order to remove the need for accessing the mapping file repeatedly. As one of the most important requirements for implementing an O/R Mapping component is that there be no loss of performance, caching can make a big difference in whether your performance requirements are met or not.
Object-Oriented Query Language
The goal of some O/R Mappers is to remove all traces of SQL from your data access code. In place of SQL, some products support a proprietary syntax for specifying what is effectively your WHERE clause criteria. Other languages, like OPath as well as expression builders, and even raw SQL, are supported in some products. What works best for you and which method of query expression you're most comfortable with might help narrow down your choices of O/R Mappers to consider. Other considerations to make in this area are whether or not you anticipate needing support for DBMS-proprietary keywords in your SQL statements, such as the TO_DATE() function in Oracle.
Object Model Support
Some O/R Mappers are said to be "non-intrusive" or to support POCO (Plain old CLR Objects) because they allow you to take your existing object model (or the objects generated by a code generator) and, with a little configuration work, map them to the existing database structure. If you have an existing object library and are looking to port it over to using an O/R Mapper or code generator, this might be a feature you'll want to look out for.