This is part 2 of a 2 part series of articles:
- In part 1, I introduced the concepts of Object Relational Mappers, and demonstrated the integration of a popular Open Source ORM called SubSonic into the Visual Studio Integrated Development Environment (IDE).
- In part 2, I shall be integrating a Kiwi ORM, LightSpeed, into Visual Studio, and comparing the products on functionality.
Who Should Read This Article |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What Is Covered in This Article |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
How Do I Use LightSpeed? | What Do I Need?
How Do I Integrate LightSpeed into Visual Studio?
How Do I Generate DAL Classes?
Consume DAL
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
How Do These Two ORMs Compare? |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Summary | In this two-part article, I have shown and compared the functionality of two different Object Relational Mappers. SubSonic is an Open-Source, simple, free utility for quickly getting data classes out of the database and into .NET design environment. LightSpeed is a commercial product, designed to optimize the developers experience through industry-standard use of LINQ and a Visual Designer to allow reverse-engineering of new class attributes back into their table columns. In the end, you will decide which criteria is more convenient for you. It has not been my intention to attempt to persuade you to decide one product over another. I hope I have adequately explained the purpose and use of Object Relational Mappers in general, by showing these two specific examples. ORMs are great time-savers for developers who have to work with existing database structures. They cut out the necessity for 90% of stored procedures in one application I was creating, because I didn’t have to worry about the four CRUD procs. This leaves more time to concentrate on the other 10% of stored procedures that are really necessary, because they can’t be done any other way. One example that comes to mind is this: suppose you had to count the number of purchase orders that a product appeared in. The LINQ way to do it is:
However, the problem with this way of doing it is that the line prd.PurchaseOrderDetailRecords.Count, in order to succeed, must first go and get all Purchase Order Detail records. This is hugely inefficient for a mere count. The better way to do this is to create a Stored Proc which accepts the Product ID and only returns the integer count. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
About the Author | James Hippolite started programming in 1983 on an Apple IIe, at the age of 14. After graduating with a bachelor degree in Information Systems from Victoria University of Wellington in New Zealand in 1990, he started working with small systems relational databases, like dBase, Paradox, FoxPro and finally Microsoft Access. In 1991 he founded Mana Information Systems, a company for SME who couldn’t afford their own IT departments. As the lead developer, he developed small to medium WinForms applications using SQL Server, Visual Basic and latterly ASP. In 2003 James developed in C# his first .NET web application, an internal metrics reporting tool for his new employer, Telecom New Zealand, utilising SQL Server stored procedures and .NET classes. Due to the absolute ease of use of ORMs, James finally converted to their use in 2008. James is slow adopter of technology, which is no reflection upon his Microsoft Certified Trainer status. He has contributed lectures on Microsoft Certification and SQL Server Reporting Services to the .NET community. He lives in Wellington and is currently employed full time in a large corporate and loving the regular hours that non-consultants enjoy. |
James
ReplyDeleteHere is an ORM that works with Microsoft Access
https://www.kellermansoftware.com/p-47-net-data-access-layer.aspx