Writing your own mapping layer

It can be very tempting to write your own object-relational mapping. If fact, there are books and articles advocating this. The bottom line, however, is that unless you have a very simple mapping, it is a bad idea to write your own mapping layer.

I have talked with plenty of developers who tried writing a mapping layer. The result, although anecdotal, is universal. The mapping code, in each case, grew to be 30 to 40 percent of the code needed for the entire application. There are two problems that resulted from this. The first is that this is a lot of effort towards writing code that is not addressing the business problem that prompted the application development in the first place. The second is that, given the development models that show how code defects rise with total code, a significant number of additional defects appeared which, again, are not directly related to the business problem being addressed by the application development.

So, if you have a relational database and you want to use C++ or Java, by all means use an object-relational product. Writing a mapping layer is much harder than you might expect. Some of the reasons this is hard can be seen in the considerations for mapping:

bulletFor object-to-table mapping, see mapping objects to tables (new window).
bulletFor table-to-object mapping, see mapping tables to objects (new window).

Related content for: Writing your own mapping layer

More on the general topic: Object-relational mapping articles
Object-relational mapping (OR mapping) definition
When object-relational mapping should be used
Basic concepts for using object-relational mapping
Mapping layer
Using existing relational schema
Article suggestions

Read more free articles on this site

There are nearly 400 pages of articles on this site with over 50 pages on object-relational mapping.

Search this site for more articles

Custom Search

Browse this site for more articles

Click on the topics below to browse the articles on this site.The arrows show the path to the current article: Writing your own mapping layer.

Web Services and Service-Oriented Architectures
Online briefings
Search results
Online articles -->
Consulting
Mentoring
Speaking
Stencils for the Savvy Manager's Guide
Links
Mail list
Privacy policy
Sitemap
Contact
Web Services articles
XML standards and vocabularies
Application server articles
Database concepts and standards
Object database articles
Relational database articles
Object-relational mapping articles -->
XML database articles
XML middleware articles
Article Sponsorship
Reprint policy
Object-relational mapping (OR mapping) definition
When object-relational mapping should be used
Basic concepts for using object-relational mapping
Mapping layer
Writing your own mapping layer
Using existing relational schema
Article suggestions

Related recent articles from Google News


Access Synergy DBMS Databases from .NET Apps and VS2008
Softpedia
NET Entity Framework is the next data-access technology from Microsoft and is Microsoft's first full-fledged move into object-relational mapping (ORM). ...

and more »

New Zealand MVPs Prepare for Code Camp!
Özel Web Tasar?m
NET languages?, Object relational mapping, Sync framework, and a whole lot more! In addition to a traditional presentation stream, there will be an ...

and more »

Xceed Enhances Data Virtualization and Data Source Support in Its ...
1888 Press Release (press release)
NET object-relational mapping framework, which facilitates the developer's job of working with different types of data sources. Other new features include ...

and more »

More related news: "object-relational mapping" - Google News

Related books at Amazon.com


Pro LINQ Object Relational Mapping in C# 2008
by Vijay P. Mehta
Average Customer Review: 4 stars based on 10 reviews.
Customer Review: If you have never written a database application this book will be way overkill for a beginner. I would say this book is targeted to the working professional who has written their own Data Access Layer in the past and are looking for best practices on how to do it in Visual Studio 2008. The samples in the book are implemented in C# ...

Object-Relational Database Development: A Plumber's Guide (With CD-ROM)
by Paul Geoffrey Brown
Average Customer Review: 5 stars based on 1 review.
Customer Review: I feel no difference between a brand new one and this

Multimedia Databases: An Object-Relational Approach
by Lynne Dunckley
Publisher: Pearson Education
Publication Date: January 2003

Object Data Management -- Object-Oriented and Extended Relational Database Systems
by Roderick G Cattell
Publisher: Addison Wesley Publishing Company
Publication Date: January 1991

Practical Application of Object-Oriented Techniques to Relational Databases (Object Management Group Series on Object Technology)
by Donald K. Burleson
Publisher: John Wiley & Sons
Publication Date: March 1994

More related books: Search Amazon.com for object relational mapping

 

Copyright © 2000-2009 Barry & Associates, Inc. All Rights Reserved.
You can use this material for your work or classes. Click here for our reprint policy.
www.service-architecture.com

 

 

Newletter Sign Up

 

 

Barry & Associates, Inc.