If only I were

Building Great Software

Function-centric to Data-centric to Model-centric

with 2 comments

I picked up book called The Waite Group’s Object-Oriented Programming in Turbo C++ recently to look at what Robert Lafore was saying about OOP 17 years ago. The book was published in 1991. I’ve just read chapter one at this point, but it was rather interesting.

Before we look at Lafore’s views, lets talk about where we are now.

A fairly common complaint we hear in 2008 is that people write their programs in a very data-centric way. They write objects for the sole purpose of CRUD but the life of the application in is the database. They might throw in bit of inheritance to make their objects feel more OO, but end of the day they are making glorified data containers that map directly to the database tables.

I was recently in an interview where one person admitted that it was easiest to start with the database and work out from there. So their “business objects” were just in-memory data containers for performing CRUD with a few useful utility methods hanging off the objects.

If you talk with people working with NHiberate, people doing DDD, an Alt.Netter or Rocky Lhotka (I realize there are very diverse view in these groups), you’ll get the view that your domain objects or your business objects should be the core of your application. I buy into this view by the way; the database is a good place to persist your data, but it shouldn’t be where you start in application design.

So what was Robert Lafore’s concern with procedural programming? Remember that in 1991 OO wasn’t mainstream. Here is a direct quote from a section called Data Undervalued in Chapter 1:

What [functions] do may be more complex or abstract, but the emphasis is still on the action.

What happens to data in this paradigm? Data is, after all, the reason for a programs existence. The important part of an inventory program isn’t a function that displays the data, or a function that checks for correct input; it’s the inventory data itself. Yet data is given a second-class status in the organization of procedural languages.

He goes on to explain that functions/methods/procedures don’t let you model the world very well. How do you model a windowing system with dropdown menus with just methods? And he is right, there needs to be more than verbs in our programming languages, we needed first-class nouns (beyond local variables) to be able to model the world better.

17 years ago coding was too action centric but Robert claims it should have been more data-centric. Now that OO is fairly mainstream coding is too data-centric, and the claim is that we need to be more model-centric.

None of these views stand on there own. If you took away functions we wouldn’t have programming; if we didn’t have data we wouldn’t have a reason to program. But I think that building out a good model that is object based and is independent of the database is just as important for application design.

What do you think about this progression? Where are we going from here?

kick it on DotNetKicks.com

About these ads

Written by Chris Sutton

August 9, 2008 at 11:01 am

Posted in Learning, Technology, Thoughts

Tagged with , , ,

2 Responses

Subscribe to comments with RSS.

  1. If we take a higher view of the IT world it is possible to identify some other cycles being repeated and other interesting paradigms. For example, in the beginning we had the terminals and everything was running on the mainframes and servers. Then came the client server era, spreading the power among the clients. Then we came back to the terminals but in the form of a browser. And if you pay close attention , we’re are starting to make our browser more robust, more “rich”. It is time for RIA (spreading the power). And so on, and on…

    If you read an ajax article , you’ll read something like this: Ajax enables the web application become much more similar to a desktop app. Cool. But if you look at some WPF article it will probably say: Now your desktop apps will look like a web app. What is going on here? Identity crisis? hehe. Win App wants to be Web app , and Web app wants to be Win app?

    Eduardo Bottcher

    August 19, 2008 at 9:13 am

  2. @Eduardo

    Good point about the cycles. It does seem that we are going in a circle, our hardware faster and shinier, but we are repeating what’s already been done.

    It seems that in the end we want applications that have powerful rendering and processing capabilities (client-side) but we want them to be connected to good back end servers. I don’t think that we’ll ever need just the client with out the server and vice versa.

    Chris

    Chris Sutton

    August 19, 2008 at 10:41 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: