Re: Object-relational impedence

From: Robert Martin <>
Date: Mon, 3 Mar 2008 16:15:33 -0600
Message-ID: <2008030316153331729-unclebob_at_objectmentorcom>

On 2008-03-03 11:36:50 -0600, "David Cressey" <> said:

> It appears, from reading c.o., that OO people regard data structures as
> evil.

Not at all. Data structures are not evil, they just aren't objects.

Objects expose behaviors and hide their data. Data structures expose their data and have no behavior. So the two are in almost diametric opposition.

Moreover, software that uses data structures is easy to add new functions to, but hard to add new data to. On the other hand, software that uses objects is easy to add new objects to but hard to add new functions to.

These two different affordances are the tools that a good architect will use to construct systems that are easy to change. The architect will use data structures in those areas where new functions are likely to be added, and will use objects in those areas where new data is likely to be added.

Robert C. Martin (Uncle Bob)  | email:
Object Mentor Inc.            | blog:
The Agile Transition Experts  | web:
800-338-6716                  |
Received on Mon Mar 03 2008 - 23:15:33 CET

Original text of this message