This content is available online.
An object-oriented system can be characterized as a system of cooperating objects. Some objects interact only with certain other objects or perhaps only with a certain set of objects. Sometimes objects are treated as equivalent even though there may be specific differences between them, for instance a situation may call for a "fruit" whereupon an "apple" will do just as well as an "orange". That is, apples and oranges are treated as abstractly equivalent. Conversely, the system designer may want to express the commonality between apples and oranges. An OO system has two distinct mechanisms to express these relationship notions: "is-a" which is technically referred to as "inheritance" and "has-a" which is technically referred to as "composition".
- 瀏覽次數:1374