ifacethoughts

OOP, Nouns, Verbs And Metaphors

Using nouns and verbs is a good way of introducing OOP. I think it is effective in breaking the mindset of procedural programming and changing the direction of thinking. It is also very effective in explaining some key concepts. However, it is effective only as a way of thinking. There can be problems when we start using it as a design philosophy.

As Buko Obele says, programming is not art. He goes on to show where nouns and verbs can create problems.

The word ‘person’ in a sentence isn’t dependent upon any notion of a particular verb, it always exists prior and apart from the sentence. In practice we would never say that a person who can’t, for example, ‘run’ isn’t a person because ‘person’ is its own word. But in object oriented design precisely the opposite is true: the person type (concept) is defined by its ability to ‘run’ and objects that don’t know to run are strictly not persons. In object oriented design concepts do not exist separately and apart from their methods at all — instead, the whole point is that they are strictly constituted by their methods. So all the talk of subjects and verbs may be a decent way to explain object oriented design but it’s self-evidently the wrong approach to doing object oriented design.

I remember Joshua Porter’s quote, which I think is valid about all designs:

Art is about personal expression, Design is about use.

But a design is useful only within its scope, anywhere outside it goes completely invalid.

The biggest problem is in using the nouns and verbs to map the two languages, that is, the natural language and the programming language. As Buko says, the natural language is full of metaphors and ambiguity and many times without any defined scope, which is of little help in designing software systems. There are lesser bindings, lesser dependencies and capabilities can vary a lot. However, we start tightening bolts when we start to define the scope for our software system. That is the time when we actually redefine, or you can say choose a subset of, the nouns and verbs for our convenience and understanding. We create associations, define capabilities, lifecycles and identify dependencies.

In my opinion nouns and verbs are very effective in identifying in what to do, who does it and catching improper assignment of responsibilities early in the design, but only if the scope is defined. Otherwise it ends up cycles of discussions and redesigns and then frustrations.

Discussion [Participate or Link]

  1. Chipping the web - simple, not secure -- Chip’s Quips said:

    [...] on the status of verbs in [...]

Say your thought!

Who are you?

If you want to use HTML you can use these tags: <a>, <em>, <strong>, <abbr>, <code>, <blockquote>. Closing the tags will be appreciated as this site uses valid XHTML.

freshthoughts

freshcomments

personalfavorites

contactme

Abhijit Nadgouda
iface Consulting
India
+91 9819820312
Y!: anadgouda
GTalk: anadgouda@gmail.com
MSN: anadgouda@hotmail.com
Skype: anadgouda

currentproject

Complete Wellbeing

thoughtfulthoughts

Sometimes the situation is only a problem because it is looked at in a certain way. Looked at in another way, the right course of action may be so obvious that the problem no longer exists.
Edward De Bono

badgesand...

This is the weblog of Abhijit Nadgouda where he writes down his thoughts on software development and related topics. You are invited to subscribe to the feed to stay updated or check out more subscription options. Or you can choose to browse by one of the topics.

Twitter - IMHO, Epiphany is by far the best browser.