Re: Retrieving unnecessary data



On Feb 21, 11:16 am, Robert Martin <uncle...@xxxxxxxxxxxxxxxx> wrote:
On 2008-02-20 11:08:37 -0600, topmind <topm...@xxxxxxxxxxxxxxxx> said:



Robert Martin wrote:
On 2008-02-19 13:14:31 -0600, topmind <topm...@xxxxxxxxxxxxxxxx> said:

Evidence that OO makes testing easier?

Function f destroys the world when it is called. Function y calls
function f. How do I test function y? I hide f behind a polymorphic
interface called IF. I implement a fake version of f called MF. I
pass MF to y and tell y to do it's thing. Then I ask MF if f was
called. The world was not destroyed, and yet I know that y will call f.

One can also write a dummy stub function f,

Sure, and sometimes that would be a good choice. Other times the
polymorphic interface would be a good choice.

or use a dummy database
(dummy world) for testing.

Ah, now that's an interesting concept.

It's common in the industry.

You mean a database that, for
all intents and purposes, looks like a production database but isn't.
You mean one that can be substutited for the production database
according to the LSP. You mean...an object?

I think that's a very good idea.

I suppose under a wide view of "OOP" it can be considered such. Then
again, one can view everything as relational also if one wants to.
LISP fans view everything as S-expressions. Everything is everything,
woo hooo!


--

Robert C. Martin (Uncle Bob) | email: uncle...@xxxxxxxxxxxxxxxx
Object Mentor Inc. | blog: www.butunclebob.com

-T-
.