Re: The wisdom of the object mentors (Was: Searching OO Associations with RDBMS Persistence Models)

From: Marshall <marshall.spight_at_gmail.com>
Date: 4 Jun 2006 16:52:01 -0700
Message-ID: <1149465121.255166.103310_at_y43g2000cwc.googlegroups.com>


Bart Wakker wrote:
> "Mikito Harakiri" <mikharakiri_nospaum_at_yahoo.com> writes:
>
> > Assertion alone is worthless without solid method that supports
> > it. And what method OO propellerheads suggest? OR mappers (which
> > essentially are reincarnated OODBMS)? What I am supposed to learn 20
> > something ad-hock mapping types instead of 6 clean relational
> > operators? Or worse yet, some "pattern"?
>
> [...]
>
> The OR mapper usually supports lazy loading: you fetch your data from
> the RDBMS before, but not all of it, just that part that you know is
> used in any case. Then inside your method, should the program need
> extra data, it doesn't have to know about how to do this, it doesn't
> need to know any data access API (be it direct or through some OR
> mapper). If just accesses/navicates to other instances as if the whole
> data had already been there.

Lazy loading is another "cure" to an iatrogenic disease. If you simply avoid the bad practices being advocated by some here, you won't have any need for nor be able to derive any benefit from lazy loading.

If your application needs to access some data, then it has to query it and get access to it before it can proceed. If on the other hand it does not need some data, then it should not query for it.

Querying for data you don't need, and failing to query for data you do need, are both results of using the unnecessary abstraction layers that some are advocating. If you simply query for exactly the data you need when you need it, lazy loading becomes irrelevant.

Marshall Received on Mon Jun 05 2006 - 01:52:01 CEST

Original text of this message