Generate Data-Access Code Quickly
by David Mack
|
Quick Facts
ORM.NET
Olero Software Web: www.olero.com
Phone: 303-385-4908
Price: $495
Quick Facts: Object-relational mapping and code-generation tool that generates C# data-access code automatically from your SQL Server database schemas and stored procedures. Lets you set scope of accessor and mutator functions for each member of your schema.
Pros: Saves substantial coding time; no requirement to know SQL or how to write stored procedures.
Cons: Supports only SQL Server and C#; dependence on third-party package to access data. |
|
Enterprise Application Lifecycle Management 2003
ORM.NET lets you generate object-oriented C# code that interfaces with SQL Server databases in much less time than it would take you to write the code by hand. It takes an existing database and stored procedures, then creates wrappers for them automatically. This saves you a tremendous amount of work vs. hand-typing the wrapper classes to access ADO.NET.
The product generates C# data-access classes, wrapper classes for stored procedures, and strongly typed code that improves IntelliSense. You'll benefit from ORM.NET the most if you have an existing database and large amounts of data-access code to write. Comparable tools require you to define your own classes and database relationships. Defining your own classes enables bugs to enter your program through typos and cut-and-paste errors. ORM.NET relieves you of these burdens. It generates classes and defines database relationships through the UI, setting relationships as "one to many" by default. It handles issues such as spaces in the database name that aren't valid in the C# variable names. ORM.NET also allows you to set the scope of your accessor or mutator functions. The UI lets you see each property's data type and whether it's declared as a key, as well as other metadata (see Figure 1). If you're reluctant to use ORM.NET on an existing database, you can use the database that comes with the product, which requires a separate installation step.
ORM.NET doesn't support VB.NET. However, you can write your business/presentation layer in VB.NET through the magic of the .NET Framework, then let ORM.NET handle the rest for you. The product doesn't support any databases other than SQL Server, and you must include an ORM.NET library in your project. Also, you'll experience a small performance hit if you use the data-access code instead of stored-procedure wrappers. Neither the built-in help nor the Web site mentions connection pooling. It would be nice to know exactly how the product handles it and what you must to do to take advantage of this feature in ADO.
Otherwise, the Olero Web site is informative and describes ORM.NET's functionality clearly. It presents a comparison between using straight ADO.NET vs. ORM.NET that's especially helpful. You can also view sample-generated code on the site.
Overall, ORM.NET's UI is intuitive and simple, as is the code that the software generates. You might view the reliance on third-party software as a maintenance issue, but the time you save writing code can easily justify its use. You'll be able to see the benefits of ORM.NET within minutes of running it the first time.
About the Author
David Mack is a technical lead for the National Intelligence Division of Titan Systems, as well as an adjunct professor at Northern Virginia Community College. He has more than 10 years of experience in object-oriented programming. Reach him at .
Back to top
|