|
The WilsonORMapper is a simple-to-use O/R Mapper (Object-Relational Mapper) for .NET v1.1 and v2.0.
What is an O/R Mapper? An O/R Mapper is a library that allows your business entity objects
to transparently load themselves from and persist themselves to a relational database.
O/R Mappers are not new -- they have been around for some time, even commonly used in Java,
but they are just now starting to catch on in Microsoft circles, largely thanks to .NET.
In fact, Microsoft will introduce their own O/R Mapper, DLinq, in a future version.
Why use an O/R Mapper? Most reasons are centered around flexibility and maintainability.
A good O/R Mapper lets you target multiple databases with one code base, with dynamic sql,
while also making search and sort much more flexible than a set of stored procedures can.
A good O/R Mapper also makes your code base much smaller, while letting you focus on your
business logic, instead of worrying about how to do routine loading and persistence calls.
Note that a good O/R Mapper does not generate code that you have to compile and maintain.
What about the downside? Most issues that people raise are based on old myths actually.
For instance, dynamic sql is compiled and cached just like stored procedures in most dbs,
so there is no loss of performance due to using dynamic sql. So that's just an old myth --
I can actually point to cases where my O/R Mapper is faster, the rest are minimally slower.
Also, parameterized dynamic sql protects you from sql injection just like stored procedures,
although its true that stored procedures do continue to allow better centralized security.
And the WilsonORMapper? It supports MS Sql, Access, Oracle, and ANSI compliant databases,
while also allowing you to optionally continue to use stored procedures if you so choose.
Its designed to be as simple to use as possible -- just create a simple xml mapping file.
There is no need for a special base class, although an optional interface avoids reflection.
Finally, its based on the syntax of the earlier MS O/R Mapper, ObjectSpaces, and it contains support for WinFS's OPath, so there is actually a good deal of information available for this.
|