Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

PDF:

Databases for REAL

Object-Relational Mapping

Making databases easier

Issue: 9.5 (July/August 2011)
Article Description: No description available.
Article Length (in bytes): 4,430
Starting Page Number: 74
RBD Number: 9511
Resource File(s): None
Related Link(s): None
Known Limitations: None

Excerpt of article text...

Last time we learned about object-relational mapping and how it can simplify your code. But an ORM is not all unicorns and rainbows. This time we're are going to look at some of the downsides of using an ORM.

Disadvantages of ORM

Can be slower than direct DB access

As you might suspect, adding another layer to your database access can make your database reads and writes a bit slower than when accessing it directly.

The framework needs to map the class properties to the database columns and eventually create an SQL statement every time that data is loaded or saved. It's also possible that the ORM will create SQL behind the scenes that is not as optimized as what you could code by hand.

This can be mitigated somewhat by having the ORM cache your data. In this case, the ORM checks the cache before going to the database at all.

Increased Memory Usage

With an ORM, each row in each database table becomes an instance of a class when you access it. If you keep all these in memory as they are accessed, you can quickly start to use up a lot of memory. And if your ORM uses caching it will also use up a lot of memory to maintain the cache.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com