Much present day commercial software development – probably the majority of it – claims to be object oriented, and at the centre of object oriented software is the object. So, what is an object? Unfortunately, the word object seems to have joined the ranks of the buzzwords. It seems to have become one of those terms that gets banded about, without its users ever stopping to ask themselves if they really know what one is. This has resulted in a lack of design discipline that I believe has strongly contributed to the poor design of many software systems. In the remainder of this article, I will give my answer to the question that its title poses.
To get to the answer, we need to step back and think about why we use objects. I’d say it’s because they enable us to represent concepts from the real world in software. These concepts might be real life things that we import from the problem domain, or things that exist only in the computer solution, for example a message receiver or a process. An object exhibits a set of operational semantics representing a concept in an abstract form. I will refer to these semantics collectively as the object’s type. It follows that a type is an abstraction of a real world concept in a software design model.
Types are therefore the role players in software designs, and they play their roles by assuming responsibilities. A type has closely related responsibilities that are grouped together to collectively make up the role played by the type. Now, having said all that, the original question was: what is an object? The above discussion leads to the following definition:
- An object is a physical manifestation of a type, that executes the responsibilities of that type
The understanding of what an object actually is only serves as a starting point for using objects effectively in software design, but I also think it is is an essential starting point. This article is rather brief because it has a very narrow scoped, its purpose being to provide an answer to a very basic question. I hope to follow up with more broadly scoped articles fairly soon.