The Artima Developer Community
Sponsored Link

Uncle Bob's Software Craftsmanship Corner
Modelling the real world.
by Robert C. Martin
March 9, 2004
Summary
The concept of modeling the real world has been so badly abused in the OO community, that I want to find the person who first coined the notion and flay him alive. (not really.)

Advertisement

I don't know who came up with "Objects should model the real world." but we need to find the guy and trash him soundly. I think it must have been some poor schmuck who was trying to sell his boss on buying an early C++ compiler. (In the mid '80s you could spend as much as $30,000 for a good compiler.) I imagine the dialog going something like this:

Schmuck: Sir, we need to buy a C++ compiler.

Boss: How much will it cost?

Schmuck: It's $30,000.

Boss: NO. That's too much money.

Schmuck: But sir, the benefits!

Boss: What benefits?

Schmuck: We'll be able to better manage dependencies!

Boss: Manage them without it.

Schmuck: But our code could be more flexible and robust.

Boss: Make it flexible and robust without it.

Schmuck: But... er.... uh....

Boss: Time is money schmuck, get to the point.

Schmuck: ...Our software will be more like a ... uh ... model of the ... uh ... real world!

Boss: Hmmmm. Software that looks like a model of the real world eh?

Schmuck: Yes sir.

Boss: Would it be easier to understand then?

Schmuck: Yes sir.

Boss: Will it allow junior developers to program like experienced developers?

(Aside to audience) If this is true, I'll be able to fire all these expensive software geeks and hire kids right out of school!

Schmuck: Well, sir, that's possible, yes. Our software would be much easier to understand since it would have a much better structure and have it's...

Boss: (Eyes glaze over, foot taps.)

Schmuck: (continuing)...dependencies so well managed. Yes sir.

Boss: OK, Schmuck, you've sold me. Go buy that compiler. But I want to see models of the real world in our software within three months or your ass will be grass.


It's true that we want the vocabulary and relationships of the problem domain represented in our objects and methods. But that's not the same as "modeling the real world".

OO was "discovered" when two guys who were using a block structured language to write a simulation engine played around with moving the stack frame for a block to the heap, thus making the blocks long-lived. Voila: objects! From this very geeky beginning, OO has grown to be a

<fanfare> Major Methodology </fanfare>


requiring

<fanfare> Management Support and Approval </fanfare>


and

<twenty-one-gun-salute> Object Modelers and Architects </twenty-one-gun-salute>


and

<30-seconds-of-silence/> U.......M.......L <cheering-of-the-multitudes/>

------>Aside. You'll probably enjoy reading Eric Evan's book "Domain Driven Design". He takes a very pragmatic view of the "real world modeling" issue, and provides lots of very good advice about it. <------

(Sigh) the hype associated with OO, and the religious zeal with which it can be (badly) practiced is sometimes disheartening. OO is a very nice tool for structuring source code and managing dependencies. And, yes, it is a good idea (as it has always been) to incorporate the vocabulary and relationships of the problem domain into the design of the source code. However, when people make software related decisions based solely upon whether or not the object properly models the real world, they need to find some other career -- because they sure aren't software developers.

Talk Back!

Have an opinion? Readers have already posted 31 comments about this weblog entry. Why not add yours?

RSS Feed

If you'd like to be notified whenever Robert C. Martin adds a new entry to his weblog, subscribe to his RSS feed.

About the Blogger

Robert C. Martin (Uncle Bob) has been a software professional since 1970 and an international software consultant since 1990. He is founder and president of Object Mentor Inc., a team of experienced consultants who mentor their clients worldwide in the fields of C++, Java, OO, Patterns, UML, Agile Methodologies, and Extreme Programming. In 1995 Robert authored the best-selling book: Designing Object Oriented C++ Applications using the Booch Method, published by Prentice Hall. From 1996 to 1999 he was the editor-in-chief of the C++ Report. In 1997 he was chief editor of the book: Pattern Languages of Program Design 3, published by Addison Wesley. In 1999 he was the editor of "More C++ Gems" published by Cambridge Press. He is co-author, with James Newkirk, of "XP in Practice", Addision Wesley, 2001. In 2002 he wrote the long awaited "Agile Software Development: Principles, Patterns, and Practices", Prentice Hall, 2002. He has published many dozens of articles in various trade journals, and is a regular speaker at international conferences and trade shows.

This weblog entry is Copyright © 2004 Robert C. Martin. All rights reserved.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us