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

From: Robert Martin <>
Date: Tue, 13 Jun 2006 12:27:52 +0200
Message-ID: <2006061312275250878-unclebob_at_objectmentorcom>

On 2006-06-05 01:52:01 +0200, "Marshall" <> said:

> 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.

In essence you are saying that indirection is unecessary. This is quite provably true. Every program composed of indirection can be rewritten without any (though they tend to grow and use lots of flags).

Clearly indirection comes with a cost. It also comes with a benfit. Engineering is the balancing act between the two. While Lazy Loading can always be eliminating, Lazy loading is sometimes beneficial as an indirection technique. It is unwise to reject it out of hand.

Robert C. Martin (Uncle Bob)  | email:
Object Mentor Inc.            | blog:
The Agile Transition Experts  | web:
800-338-6716                  |
Received on Tue Jun 13 2006 - 12:27:52 CEST

Original text of this message