What Is An Object?
Ans : An object is a software unit that combines a structured set of data with a set of operations for inspecting and manipulating that data. Object-oriented programming reverses the function-data relationship familiar from non-object-oriented languages, such as C. Programs in C (similarly Pascal, or Basic) are often based on direct data manipulation: they define data structures and provide functions that inspect or change that data from anywhere else in the program. Intimate knowledge of data structures can be spread throughout the program, and changing a structure in one part can have drastic consequences for many other parts of the program. Object-oriented programming provides standard tools and techniques for reducing dependencies between different parts of a program. An object starts with a structured set of data, but also includes a set of operations for inspecting and manipulating that data. In an object, all operations that require intimate knowledge of the data structure are d
There are many definitions of an object, such as found in [Booch 94, p83]: “An object has state, behavior, and identity; the structure and behavior of similar objects are defined in their common class; the terms instance and object are interchangeable”. This is a “classical languages” definition, as defined in [Coplien 92, p280], where “classes play a central role in the object model”, since they do not in prototyping/delegation languages. “The term object was first formally applied in the Simula language, and objects typically existed in Simula programs to simulate some aspect of reality” [Booch 94, p82]. Other definitions referenced by Booch include Smith and Tockey: “an object represents an individual, identifiable item, unit, or entity, either real or abstract, with a well-defined role in the problem domain.” and [Cox 91]: “anything with a crisply defined boundary” (in context, this is “outside the computer domain”. A more conventional definition appears on pg 54). Booch goes on to