home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / object-faq / part1 < prev    next >
Encoding:
Text File  |  1995-07-25  |  58.2 KB  |  1,167 lines

  1. Subject: Comp.Object FAQ Version 1.0.7 (10-27) Part 1/10
  2. Newsgroups: comp.object,comp.answers,news.answers
  3. From: Bob Hathaway <rjh@geodesic.com>
  4. Date: 29 Oct 1994 11:42:06 GMT
  5.  
  6. Archive-name: object-faq/part1
  7. Last-Modified: 10/27/94
  8. Version: 1.0.7
  9.  
  10.  
  11. COMP.OBJECT FAQ
  12. Version: 1.0.7
  13. Date:    10/27/1994
  14.  
  15.  
  16. Author:
  17.   Bob Hathaway
  18.   Geodesic Systems, Inc.
  19.   Cyberdyne Systems Corporation
  20.   rjh@geodesic.com
  21.  
  22.  
  23. Anonymous FTP Sites and Hypertext Server:
  24.   anonymous@zaphod.uchicago.edu:/pub/CompObj7.faq(.Z)     (128.135.72.61)
  25.   anonymous@rtfm.mit.edu:/pub/usenet/comp.object/*_Part_* (18.181.0.24 Tmp)
  26.   http://iamwww.unibe.ch/~scg/OOinfo/FAQ/index.html       (new IAM location)
  27.  
  28. Mail Server:  (See also section 1.24)
  29.   mail mail-server@rtfm.mit.edu
  30.   Subject:
  31.   send usenet/comp.object/*
  32.  
  33. Zaphod is preferred over rtfm for anonymous ftp retrieval, as it provides a
  34. single file.  Rtfm contains the FAQ as posted.
  35.  
  36. To use the hypertext system, see APPENDIX E, entries 27.
  37. There is currently no comp.object archive.
  38.  
  39. Copyright 1992-1994  Bob Hathaway
  40. All rights reserved.
  41.  
  42. Permission is granted to freely copy and distribute this document but only
  43. with this full header attached and at no cost to others with the exception
  44. of a nominal distribution fee, if any.  No sale, resale or reprinting is
  45. granted without the explicit written permission of the author.
  46.  
  47. Contributors:  Per Abrahamsen, Edwardo Casais, Stewart Clamen, Dennis De
  48.   Champeaux, Mike DeVaney, Eric Dujardin, Piercarlo Grandi, Brian Henderson-
  49.   Sellers, Urs Hoelzle, Paul Johnson, Bill Kinnersley, Oscar Nierstrasz, 
  50.   James Odell, Eoin Woods, and many others whose contributions have helped this
  51.   document to fulfull its objective of bringing object-oriented concepts and
  52.   systems to everyone.
  53.   
  54.   Special thanks to Object Systems, Geodesic Systems and Cyberdyne Systems for
  55.   providing the support and resources needed to make this effort possible.
  56.  
  57. Objective:
  58.   In the spirit of other FAQs, to provide a simple document to answer the most
  59.   frequently asked and recurring questions and to allow new users to understand
  60.   frequently discussed topics and terms used in comp.object.   This should
  61.   bring new comp.object readers and/or writers to at least an introductory
  62.   level of comprehension as soon as possible.  Other goals (hopes) are to
  63.   provide a quick and current reference on available systems such as object-
  64.   oriented languages, CASE, OODB and etc. and to provide good references to
  65.   current and relevant OO systems, groups, texts and literature.
  66.  
  67. Disclaimer:
  68.   This document does not necessarily reflect the opinions of the author's or
  69.   any contributor's companies.  There are no explicit or implicit guarantees
  70.   implied by this document.
  71.  
  72. While object systems are a constantly changing and moving target with a broad
  73. diversity of often conflicting methodologies, constructs, terminologies,
  74. approaches, languages, implementations and etc. and comp.object has a wide
  75. diversity of readers and writers ranging from students, professors and
  76. researchers in academia to beginners, professionals, top-notch experts and
  77. leaders in industry with a broad range of experience and backgrounds ranging
  78. across many paradigms, this FAQ can certainly not aspire to satisfy all of them
  79. completely but instead attempts to provide the most well-rounded treatment of
  80. object-oriented concepts and realizations primarily from the mainstream and
  81. popular authors and systems and further to provide a collection of available
  82. systems and tools in the appendices.
  83.  
  84. Several improvements are planned for future FAQs, including a glossary.
  85.  
  86.  
  87. SECTION 1:  BASICS
  88.   1.1)  What Is An Object?
  89.   1.2)  What Is Object Encapsulation (Or Protection)?
  90.   1.3)  What Is A Class?
  91.   1.4)  What Is A Meta-Class?
  92.   1.5)  What Is The Infinite Regress Of Objects And Classes?
  93.   1.6)  What are MOPs and Reflection?
  94.   1.7)  What Is Inheritance?
  95.   1.8)  What Is Multiple Inheritance?
  96.   1.9)  Does Multiple Inheritance Pose Any Additional Difficulties?
  97.   1.10) What Is Dynamic Inheritance?
  98.   1.11) What Is Shared (Repeated) Inheritance?
  99.   1.12) Why Use Inheritance?
  100.   1.13) Why Don't Some People Like Inheritance?
  101.   1.14) What Is Specialization/Generalization/Overriding?
  102.   1.15) What Is The Difference Between Object-Based And Object-Oriented?
  103.   1.16) Is A Class An Object?
  104.   1.17) Is An Object A Class?
  105.   1.18) What Is A Method? (And Receiver And Message)
  106.   1.19) What Are Multi-Methods And Multiple-Polymorphism?
  107.   1.20) What Is OOP?
  108.   1.21) What Is OOA/OOD (And Where Can I Get What I Need On It)?
  109.   1.22) Where Did Object-Orientation Come From?
  110.   1.23) What Are The Benefits Of Object-Orientation?
  111.   1.24) What Other FAQs Are available?
  112.  
  113. SECTION 2:  TYPING
  114.   2.1)  What Is Polymorphism?
  115.   2.2)  What Does Polymorphism Boil Down To In OO Programming Languages?
  116.   2.3)  What Is Dynamic Binding?
  117.   2.4)  Is There A Difference Between Being A Member Or Instance Of A Class?
  118.   2.5)  What Is This I Read About ML And Functional Programming Languages?
  119.   2.6)  What Is the Difference Between Static And Dynamic Typing?
  120.   2.7)  What Is A Separation Between Type And Class (Representation)?
  121.   2.8)  What Are Generics And Templates?
  122.  
  123. SECTION 3:  GENERAL
  124.   3.1)  What Is The "Classical" Object-Oriented Paradigm?
  125.   3.2)  What Is The "Delegation/Prototyping" Object-Oriented Paradigm?
  126.   3.3)  Are There Any Other Object-Oriented Paradigms?
  127.   3.4)  What Are The Major Object-Oriented Programming Languages Today?
  128.   3.5)  What Are Object-Oriented Databases And Persistence?
  129.   3.6)  What Are Object-Oriented Operating Systems?
  130.   3.7)  What Are The Current Object-Oriented Methodologies?
  131.   3.8)  What Is The OMG/OMA/ORB/CORBA?
  132.   3.9)  Why Is Garbage Collection A Good Thing?
  133.   3.10) What Can I Do To Teach OO To The Kids?
  134.   3.11) What Is Available On Object-Oriented Testing?
  135.   3.12) What Distributed Systems Are Available?
  136.   3.13) What Is The MVC Framework?
  137.   3.14) What Is Real-Time?
  138.   3.15) What Is Available on OO Metrics?
  139.  
  140. SECTION 4:  COMMONLY ASKED LANGUAGE SPECIFIC QUESTIONS
  141.   4.1)  What Is Downcasting?
  142.   4.2)  What Are Virtual Functions?
  143.   4.3)  Can I Use Multiple-Polymorphism Or Multi-Methods In C++?
  144.   4.4)  Can I Use Dynamic Inheritance In C++?
  145.  
  146. ANNOTATED BIBLIOGRAPHY
  147.  
  148. APPENDIXES
  149.   APPENDIX A  VIPS
  150.   APPENDIX B  OBJECT-ORIENTED DATABASES AND VENDORS
  151.   APPENDIX C  OBJECT-ORIENTED LANGUAGES AND VENDORS
  152.   APPENDIX D  OBJECT-ORIENTED CASE (OOA/D/P TOOLS) AND VENDORS
  153.   APPENDIX E  ANONYMOUS FTP SITES
  154.   APPENDIX F  MAGAZINES, JOURNALS AND NEWSLETTERS
  155.  
  156. [Another appendix on miscellaneous commercial object-oriented systems should
  157.  be added soon for completeness]
  158.  
  159.  
  160. SECTION 1:  BASICS
  161. ==================
  162.  
  163. Suggested Readings:
  164.   [Booch 91, 94]
  165.   Others to be added...
  166.  
  167.  
  168. 1.1) What Is An Object?
  169. -----------------------
  170.  
  171. There are many definitions of an object, such as found in [Booch 91, p77]:
  172. "An object has state, behavior, and identity; the structure and behavior of
  173. similar objects are defined in their common class; the terms instance and
  174. object are interchangeable".  This is a "classical languages" definition, as
  175. defined in [Coplien 92, p280], where "classes play a central role in the
  176. object model", since they do not in prototyping/delegation languages.  
  177. "The term object was first formally applied in the Simula language, and
  178. objects typically existed in Simula programs to simulate some aspect of
  179. reality" [Booch 91, p77].  Other definitions referenced by Booch include
  180. Smith and Tockey: "an object represents an individual, identifiable item,
  181. unit, or entity, either real or abstract, with a well-defined role in the
  182. problem domain." and [Cox 91]: "anything with a crisply defined boundary"
  183. (in context, this is "outside the computer domain".  A more conventional
  184. definition appears on pg 54).  Booch goes on to describe these definitions
  185. in depth.  [Martin 92, p 241] defines: "An "object" is anything to which a
  186. concept applies", and "A concept is an idea or notion we share that applies
  187. to certain objects in our awareness".  [Rumbaugh 91] defines: "We define an
  188. object as a concept, abstraction or thing with crisp boundaries and meaning for
  189. the problem at hand." [Shlaer 88, p 14] defines: "An object is an abstraction
  190. of a set of real-world things such that:
  191.   * all of the real-world things in the set - the instances - have the same
  192.     characteristics
  193.   * all instances are subject to and conform to the same rules"
  194. and on identifying objects: "What are the *things* in this problem?  Most of
  195. the things are likely to fall into the following five categories: Tangible
  196. things, Roles, Incidents, Interactions, and Specifications."  [Booch 91, 4.3]
  197. covers "Identifying Key Abstractions" for objects and classes based on an
  198. understanding of the problem domain and [Jacobson 92] provides a novel approach
  199. to identifying objects through use-cases, leading to a use-case driven design.
  200. Jacobson also classifies objects into interface objects (e.g. GUI), entity
  201. objects (corresponding to real-world objects), and control objects (introduced
  202. in design).
  203.  
  204. The implementation of objects could roughly be categorized into descriptor-
  205. based, capability-based, and simple static-based approaches.  Descriptor-
  206. based approaches (e.g. Smalltalk handles) allow powerful dynamic typing, as
  207. do the capability-based approaches which are typically found in object-
  208. oriented databases and operating systems (object id's).  A "proxy" based
  209. approach with an added layer of indirection to Smalltalk's handles is found
  210. in Distributed Smalltalk which allows transparent, distributed, and migrating
  211. objects [Kim 89, ch 19 and Yaoqing 93].  Simple static approaches are found in
  212. languages such as C++, although the new RTTI facility will supply simple
  213. dynamic typing similar to those introduced by Eiffel in 1989 through the notion
  214. of assignment attempt.
  215.  
  216. Descriptor-based approaches can have pointer semantics and can be statically
  217. typeless (or just "typeless", as in Smalltalk) where references (variables)
  218. have no type, but the objects (values) they point to always do.  An untyped
  219. pointer (such as void* in C++) and an embedded dynamic typing scheme are used
  220. in more conventional languages to fully emulate this style of dynamically typed
  221. programming (see sections 2.3, 4.3, and [Coplien 92]).
  222.  
  223. Below is a simple example to show a most trivial case of OO implementation.
  224. It is primarily intended to introduce new terms.  See [Cardelli 85] for
  225. another semantic definition of OO using functions for methods and for
  226. a view of types as sets of values.
  227.  
  228. Simple statically-typed objects (static and auto vars and temps in C++ and
  229. expanded types in Eiffel) can be viewed as instances of a record type,
  230. whose record fields are called instance variables (Smalltalk) or member data
  231. (C++).  The record (class) may also contain operations which are called
  232. methods (Smalltalk) or member functions (C++) which are equivalent to a
  233. function taking an object of the record type, called the receiver, as the
  234. first parameter.  The receiver is called self (Smalltalk) or this (C++).
  235. Members will denote both instance variables and methods.  Inheritance is
  236. roughly equivalent to a loosely coupled variant record, with derived classes
  237. as variant parts and with multiple-inheritance concatenating several records
  238. to serve as a base.
  239.  
  240. A virtual member in statically typed languages is a base class member that can
  241. be set or respecified by a derived class.  This is roughly equivalent to a
  242. pointer or function pointer in the base class being set by the derived class.
  243. [Stroustrup 90] covers the implementation details of virtual member functions
  244. in C++, which also involve an offset for the receiver to handle multiple-
  245. inheritance.  This is an example of dynamic binding, which replaces a
  246. switch statement on variant parts with a single call, reducing code size
  247. and program complexity (fewer nested programming constructs) and allowing
  248. variants to be added without modifying client code (which causes higher defect
  249. injection rates during maintanance and debugging).
  250.  
  251. Virtual members in dynamically typed languages are more flexible because
  252. static typechecking requirements are dropped.  See section 2.5.
  253.  
  254. The terms method/member function, instance variable/member data, subclass/
  255. derived class, parent class/base class, and etc. will be used interchangeably.
  256. As pointed out in [Stroustrup 90, p197], the base/derived class terminology
  257. may be preferable to the sub/super-class terminology, and is preferred in
  258. this document also.
  259.  
  260. Delegation/prototyping languages [Kim 89, ch3; Ungar 87, Sciore 89] have a more
  261. flexible kind of object which can play the role of classes in classical OO
  262. languages.  Since there is no separate class construct in these languages, and
  263. only objects, they are referred to as single-hierarchy, or 1 Level systems.
  264. Objects contain fields, methods and delegates (pseudo parents), whereas
  265. classical object-oriented languages associate method, field and parent
  266. definitions with classes (and only associate state and class with objects,
  267. although vtables of function pointers for dynamic binding is an exception).
  268. However, one-level objects often play the role of classes to take advantage of
  269. sharing and often instances will simply delegate to parents to access methods
  270. or shared state, otherwise idiosyncratic objects, a powerful and natural
  271. concept, will result.  Typical 1 Level objects can contain any number of
  272. fields, methods and parents and any object can be used as a template/exemplar,
  273. thus performing the classical role of a class.  In typical prototyping systems,
  274. parents (as any other member) can be added or changed dynamically, providing
  275. dynamic multiple inheritance (or more typically simple delegation).  Here, the
  276. term "Prototype" usually refers to prototype theory, a recent theory of
  277. classification where any object can be inherited from or cloned to serve as a
  278. prototype for newly created instances.  [The Author also uses the term for
  279. languages providing high quality support for rapid prototyping, although this
  280. usage is atypical]  See [Booch 94, pp 154-155] for a brief discussion of
  281. prototype theory in the context of OOA and OOD.
  282.  
  283. It is common in such systems for an object to "become" another kind of object
  284. by changing its parent.  A good example is a window becoming an icon, since
  285. window and icon objects display different behavior (although cognitive
  286. differences are significant too:-)  Delegation refers to delegating the
  287. search for an attribute to a delegate, and is therefore more of a pure
  288. message passing mechanism (as with dynamic scoping) than inheritance, which
  289. also typically specifies non-shared state when used for representation.
  290.  
  291. Chambers has proposed an interesting variation called "Predicate Classes"
  292. [Chambers 93] as a part of his Cecil language.  These classes will only be
  293. parents when certain predicates are true.  This can support a types/classes
  294. as collections of objects view, which is the same as the types as sets of
  295. values view taken by [Cardelli 85].  [Martin 92] provides some examples of
  296. this view applied during OOA.
  297.  
  298. 1 level systems therefore provide the most flexible and powerful capabilities.
  299. Self is a good example of a delegation-based single hierarchy language [Ungar
  300. 87].
  301.  
  302.  
  303. 1.2)  What Is Object Encapsulation (Or Protection)?
  304. ---------------------------------------------------
  305.  
  306. [Booch 91, p. 45] defines: "Encapsulation is the process of hiding all of the
  307. details of an object that do not contribute to its essential characteristics."
  308.  
  309. [Coad 91, 1.1.2] defines: "Encapsulation (Information Hiding).  A principle,
  310. used when developing an overall program structure, that each component of a 
  311. program should encapsulate or hide a single design decision...  The interface
  312. to each module is defined in such a way as to reveal as little as possible
  313. about its inner workings.  [Oxford, 1986]"
  314.  
  315. Some languages permit arbitrary access to objects and allow methods to be
  316. defined outside of a class as in conventional programming.  Simula and
  317. Object Pascal provide no protection for objects, meaning instance variables
  318. may be accessed wherever visible.  CLOS and Ada allow methods to be defined
  319. outside of a class, providing functions and procedures.  While both CLOS
  320. and Ada have packages for encapsulation, CLOS's are optional while Ada's
  321. methodology clearly specifies class-like encapsulation (Adts).
  322.  
  323. However most object-oriented languages provide a well defined interface to
  324. their objects thru classes.  C++ has a very general encapsulation/protection
  325. mechanism with public, private and protected members.  Public members (member
  326. data and member functions) may be accessed from anywhere.  A Stack's Push and
  327. Pop methods will be public.  Private members are only accessible from within
  328. a class.  A Stack's representation, such as a list or array, will usually be
  329. private.  Protected members are accessible from within a class and also from
  330. within subclasses (also called derived classes).  A Stack's representation
  331. could be declared protected allowing subclass access.  C++ also allows a
  332. class to specify friends (other (sub)classes and functions), that can access
  333. all members (its representation).  Eiffel 3.0 allows exporting access to
  334. specific classes.
  335.  
  336. For another example, Smalltalk's class instance variables are not accessible
  337. from outside of their class (they are not only private, but invisible).
  338. Smalltalk's methods are all public (can be invoked from anywhere), but a
  339. private specifier indicates methods should not be used from outside of the
  340. class.  All Smalltalk instance variables can be accessed by subclasses, 
  341. helping with abstract classes and overriding.
  342.  
  343. Another issue is per-object or per-class protection.  Per-class protection
  344. is most common (e.g. Ada, C++, Eiffel), where class methods can access any
  345. object of that class and not just the receiver.  Methods can only access the
  346. receiver in per-object protection.  This supports a subtyping model, as any
  347. object other than the receiver is only satisfying an abstract type interface,
  348. whereby no method or object structure can be inferred in the general case.
  349.  
  350.  
  351. 1.3  What Is A Class?
  352. --------------------
  353.  
  354. A class is a general term denoting classification and also has a new meaning
  355. in object-oriented methods.  Within the OO context, a class is a specification
  356. of structure (instance variables), behavior (methods), and inheritance
  357. (parents, or recursive structure and behavior) for objects.  As pointed out
  358. above, classes can also specify access permissions for clients and derived
  359. classes, visibility and member lookup resolution.  This is a feature-based or
  360. intensional definition, emphasizing a class as a descriptor/constructor of
  361. objects (as opposed to a collection of objects, as with the more classical
  362. extensional view, which may begin the analysis process).
  363.  
  364. Original Aristotlean classification defines a "class" as a generalization of
  365. objects:
  366. [Booch 91, p93]
  367.   "a group, set, or kind marked by common attributes or a common attribute; a
  368.    group division, distinction, or rating based on quality, degree of
  369.    competence, or condition".
  370.    
  371. [Booch's definition in the context of OOD]
  372.   "A class is a set of objects that share a common structure and a common
  373.   behavior."  "A single object is simply an instance of a class."
  374.  
  375. The intension of a class is its semantics and its extension is its instances
  376. [Martin 92].
  377.  
  378. [Booch 94, 4.2] proposes 3 views of classification as useful in OO analysis and
  379. design: classical categorization (common properties), conceptual clustering
  380. (conceptual descriptions), and prototype theory (resemblance to an exemplar).
  381. He advocates starting with the former approach, turning to the second approach
  382. upon unsatisfactory results, and finally the latter if the first two approaches
  383. fail to suffice.
  384.  
  385.  
  386. 1.4)  What Is A Meta-Class?
  387. ---------------------------
  388.  
  389. [See also section 1.6]
  390.  
  391. A Meta-Class is a class' class.  If a class is an object, then that object
  392. must have a class (in classical OO anyway).  Compilers provide an easy way to
  393. picture Meta-Classes.  Classes must be implemented in some way; perhaps with
  394. dictionaries for methods, instances, and parents and methods to perform all
  395. the work of being a class.  This can be declared in a class named "Meta-Class".
  396. The Meta-Class can also provide services to application programs, such as
  397. returning a set of all methods, instances or parents for review (or even
  398. modification).  [Booch 91, p 119] provides another example in Smalltalk with
  399. timers.  In Smalltalk, the situation is more complex.  To make this easy, refer
  400. to the following listing, which is based on the number of levels of distinct
  401. instantiations:
  402.  
  403. 1 Level System
  404.   All objects can be viewed as classes and all classes can be viewed as
  405.   objects (as in Self).  There is no need for Meta-Classes because objects
  406.   describe themselves.  Also called "single-hierarchy" systems.
  407.   There is only 1 kind of object.
  408. 2 Level System
  409.   All Objects are instances of a Class but Classes are not accessible to
  410.   programs (no Meta-Class except for in the compiler and perhaps for type-safe
  411.   linkage, as in C++).
  412.   There are 2 kinds of distinct objects: objects and classes.
  413. 3 Level System
  414.   All objects are instances of a class and all classes are instances of
  415.   Meta-Class.  The Meta-Class is a class and is therefore an instance of
  416.   itself (really making this a 3 1/2 Level System).  This allows classes to
  417.   be first class objects and therefore classes are available to programs.
  418.   There are 2 kinds of distinct objects (objects and classes), with a
  419.   distinguished class, the metaclass.
  420. 5 Level System
  421.   What Smalltalk provides.  Like a 3 Level System, but there is an extra level
  422.   of specialized Meta-Classes for classes.  There is still a Meta-Class as in 
  423.   a 3 Level System, but as a class it also has a specialized Meta-Class, the
  424.   "Meta-Class class" and this results in a 5 Level System: 
  425.     object
  426.     class
  427.     class class (Smalltalk's Meta-Classes)
  428.     Meta-Class
  429.     Meta-Class class
  430.  
  431.   The "class class"es handle messages to classes, such as constructors and
  432.   "new", and also "class variables" (a term from Smalltalk), which are
  433.   variables shared between all instances of a class (static member data in
  434.   C++).  There are 3 distinct kinds of objects (objects, classes, and
  435.   metaclasses).
  436.  
  437.  
  438. 1.5)  What Is The Infinite Regress Of Objects And Classes?
  439. ----------------------------------------------------------
  440.  
  441. In the authors opinion, a myth.  The story goes an object is an instance of a
  442. class (Meta-Object), a class is an instance of a Meta-Class, which must also
  443. be an instance of a Meta-Meta-Class, which must also be an instance of a Meta-
  444. Meta-Meta-Class, ...  Closure can be achieved with an instance-of loop, as with
  445. a Meta-Class being an instance of itself or with a "Meta-Class - Meta-Class
  446. class" instance-of loop (as in Smalltalk).
  447.  
  448.  
  449. 1.6)  What Are MOPs And Reflection?
  450. -----------------------------------
  451.  
  452. MOP is an acronym for Meta-Object Protocol.  This is a system with
  453. Meta-Classes accessible to users [Kiczales 92, Paepcke 93].  In CLOS
  454. terminology, an introspective protocol provides a read only capability (e.g.
  455. what is this object's class, give info on this class, etc.) and an
  456. intercessory protocol provides a write capability which allows system
  457. modification (e.g. add the following method or instance to this class,
  458. perform inheritance this way, etc.).  Because inheritance can be used to
  459. perform differential changes, intercessory protocols allow users to not
  460. only define new frameworks but to specialize existing system frameworks
  461. differentially without affecting them and their extant objects.  Thus, many
  462. frameworks can interoperate together simultaneously.  This is a good example
  463. of object-oriented reuse, since the compiler itself is reused thru
  464. specialization to provide new frameworks.
  465.  
  466. "Reflective" systems are systems with MOPs (not to be confused with reflexive
  467. systems, which often refer to systems implemented in terms of themselves, or
  468. bootstrapped).  Reflective systems are inevitably reflexive (as are most
  469. quality compilers), providing a direct program interface to the system.
  470.  
  471.  
  472. 1.7)  What Is Inheritance?
  473. --------------------------
  474.  
  475. Inheritance provides a natural classification for kinds of objects and allows
  476. for the commonality of objects to be explicitly taken advantage of in modeling
  477. and constructing object systems.  Natural means we use concepts,
  478. classification, and generalization to understand and deal with the complexities
  479. of the real world.  See the example below using computers.
  480.  
  481. Inheritance is a relationship between classes where one class is the parent
  482. (base/superclass/ancestor/etc.) class of another.  Inheritance provides
  483. programming by extension (as opposed to programming by reinvention
  484. [LaLonde 90]) and can be used as an is-a-kind-of (or is-a) relationship or
  485. for differential programming.  Inheritance can also double for assignment
  486. compatibility (see section 2.7).
  487.  
  488. In delegation languages, such as Self, inheritance is delegation where objects
  489. refer to other objects to respond to messages (environment) and do not
  490. respecify state by default.
  491.  
  492. Inherited parents can specify various flavors of state.  Delegation languages
  493. don't specify new state by default (to do so requires cloning), C-based (C++,
  494. Objective-C, etc.), lisp-based (CLOS, Flavors, Scheme, etc.), and Pascal-based
  495. (Ada-9x, Modula-3, Object Pascal, etc.) OO languages do, but with multiple-
  496. inheritance can also share parents within a class lattice (CLOS and Eiffel
  497. provide this as a default at the level of slots and features, respectively).
  498.  
  499. Inheritance also provides for member lookup, or internal environment.  Various
  500. schemes exist, for example C++ finds the closest match within a scope but
  501. causes an ambiguity error iff more than one parent has match, CLOS creates
  502. a linear precedence list, Self provides parent priorities, and Eiffel forces
  503. renaming for any parent member conflicts.
  504.  
  505. Defining inheritance (with a thorough description or denotational semantic
  506. definition, or both) can avoid confusion about which inheritance scheme is
  507. being used (especially in OOD), because inheritance has many variations and
  508. combinations of state and environment (sometimes with complex rules).
  509. Inheritance can also be used for typing, where a type or class can be used to
  510. specify required attributes of a matching object (see sections 2.1, 2.7 and
  511. [Cardelli 85]).  It would be more judicious to have discussions on how
  512. inheritance should be defined instead of over what it is, since it has many
  513. existing uses and semantics.
  514.  
  515. An example of the is-a-kind-of relationship is shown below.  Is-a is often
  516. used synonymously, but can be used to show the "object is-a class"
  517. instantiation relationship.  In classical OO, inheritance is a relationship
  518. between classes only.  In one-level systems, is-a (object instantiation) and
  519. is-a-kind-of (inheritance) are merged into one [Ungar 87, Madsen 93, Sciore
  520. 89].
  521.  
  522.                                Computer
  523.                               /    |     \
  524.                        Mainframe  Mini    Personal
  525.                         /    \    ...       /   \
  526.                   Data Proc  Scientific   PC    Workstation
  527.  
  528. Class hierarchies are subjective [Booch 91, 4.2; Lakoff 87] and usually drawn
  529. with the parent class on top, but more demanding graphs (as is often the case
  530. in [Rumbaugh 91]) allow any topology, with the head of an arrow indicating the
  531. base class and the tail indicating the derived class.
  532.  
  533. Differential programming is the use of inheritance to reuse existing classes
  534. by making a small change to a class.  Creating a subclass to alter a method
  535. or to add a method to a parent class is an example.
  536.  
  537.  
  538. 1.8)  What Is Multiple Inheritance?
  539. -----------------------------------
  540.  
  541. Multiple Inheritance occurs when a class inherits from more than one parent.
  542. For example, a person is a mammal and an intellectual_entity, and a document
  543. may be an editable_item and a kind of literature.
  544.  
  545. Mixin's is a style of MI (from flavors) where a class is created to provide
  546. additional attributes or properties to other classes.  They are intended to be
  547. inherited by any class requiring them.  Method combination, or calling
  548. sequences of before, after, and around methods or even several primary methods
  549. [Kim 89, ch 4], make good use of mixins by invoking their methods without
  550. explicitly calling them, allowing client class code to remain unchanged [Booch
  551. 91, p 113].
  552.  
  553.  
  554. 1.9)  Does Multiple Inheritance Pose Any Additional Difficulties?
  555. -----------------------------------------------------------------
  556.  
  557. Yes, it does.  Any name can be simply resolved to a class member with single
  558. inheritance by simply accessing the first name encountered for data members
  559. and by accessing the first signature match (or ambiguity) encountered for
  560. methods (at least one way, C++ hides some member functions).  Since several
  561. distinct parents can declare a member within a multiple inheritance hierarchy,
  562. which to choose becomes an issue.  Eiffel forces derived classes to rename
  563. parent members that conflict.  Self prioritizes parents.  CLOS merges member
  564. "slots" (instance variables) with the same name into a single slot, as did
  565. the earlier flavors.  C++ declares an error iff a conflict arises, but a
  566. class qualifier can be used to explicitly disambiguate.  Smalltalk renders
  567. same names for instance variables of subclasses illegal.
  568.  
  569. On the other hand, multiple-inheritance can be seen as required for basic
  570. object-oriented programming, because many objects in the real world belong to
  571. several classes.  In classical systems without MI, a class which should inherit
  572. from more than one class must textually include all but one of those classes in
  573. its interface, causing code duplication (and a messy interface).
  574.  
  575.  
  576. 1.10)  What Is Dynamic Inheritance?
  577. -----------------------------------
  578.  
  579. Dynamic inheritance allows objects to change and evolve over time.  Since base
  580. classes provide properties and attributes for objects, changing base classes
  581. changes the properties and attributes of a class.  A previous example was a
  582. window changing into an icon and then back again, which involves changing a
  583. base class between a window and icon class.
  584.  
  585. More specifically, dynamic inheritance refers to the ability to add, delete,
  586. or change parents from objects (or classes) at run-time.  Actors, CLOS, and
  587. Smalltalk provide dynamic inheritance in some form or other.  Single hierarchy
  588. systems, such as Self, provide dynamic inheritance in the form of delegation
  589. [Ungar 87].
  590.  
  591. See also [Kim 89, chs 1, 3] for a discussion and [Coplien 92] for some
  592. implementation discussion in C++.
  593.  
  594.  
  595. 1.11)  What Is Shared (Repeated) Inheritance?
  596. ---------------------------------------------
  597.  
  598. Multiple Inheritance brings up the possibility for a class to appear as a
  599. parent more than once in a class graph (repeated inheritance), and there is
  600. then a potential to share that class.  Only one instance of the class will
  601. then appear in the graph (as is always the case in CLOS, because all *members*
  602. with the same name will be shared (receive a single slot) with the greatest
  603. common subtype as its type).  C++ provides an alternative, where only parents
  604. specified as virtual (virtual bases) are shared within the same class lattice,
  605. allowing both shared and non-shared occurrences of a parent to coexist.  All
  606. "features" in Eiffel (C++ members) of a repeated parent that are not to be
  607. shared must be renamed "along an inheritance path", else they are shared by
  608. default.  This allows a finer granularity of control and consistent name
  609. resolution but requires more work for parents with many features.
  610.  
  611.  
  612. 1.12)  Why Use Inheritance?
  613. ---------------------------
  614.  
  615. Inheritance is a natural way to model the world or a domain of discourse,
  616. and so provides a natural model for OOA and OOD (and even OOP).  This is
  617. common in the AI domain, where semantic nets use inheritance to understand
  618. the world by using classes and concepts for generalization and categorization,
  619. by reducing the real-world's inherent complexity.
  620.  
  621. Inheritance also provides for code and structural reuse.  In the above Computer
  622. class diagram, all routines and structure available in class Computer are
  623. available to all subclasses throughout the diagram.  All attributes available
  624. in Personal computers are also available to all of its subclasses.  This kind
  625. of reuse takes advantage of the is-a-kind-of relationship.  Class libraries
  626. also allow reuse between applications, potentially allowing order-of-magnitude
  627. increases in productivity and reductions in defect rates (program errors),
  628. as library classes have already been tested and further use provides further
  629. testing providing even greater reliability.
  630.  
  631. With differential programming, a class does not have to be modified if it is
  632. close to what's required; a derived class can be created to specialize it.
  633. This avoids code redundancy, since code would have to be copied and modified
  634. otherwise.  See [Raj 89] for an alternative approach as found in Jade.
  635.  
  636. Polymorphism is often explicitly available in many OO languages (such as C++,
  637. CLOS, Eiffel, etc.) based on inheritance when type and class are bound together
  638. (typing based on subclassing, or subclass polymorphism), since only an object
  639. which is a member of (inherits from) a class is polymorphically assignment
  640. compatible with (can be used in place of) instances or references of that
  641. class.  Such assignment can result in the loss of an object's dynamic type in
  642. favor of a static type (or even loss of an object's representation to that of
  643. the static class, as in C++ slicing).  Maintaining the dynamic type of objects
  644. can be provided (and preferred); however, C++ provides both sliced and non-
  645. sliced replacement in a statically typed environment (see section 2.1).
  646.  
  647.  
  648. 1.13)  Why Don't Some People Like Inheritance?
  649. ----------------------------------------------
  650.  
  651. Some people complain that inheritance is hierarchical (which is what most
  652. object-oriented languages provide).  They would also like to see more
  653. operations available (set operations are quite common in specialized systems).
  654. The former is a kind of language dependent feature commonly found in object-
  655. oriented languages which are then associated with the term "inheritance"
  656. (although they don't need to be.  For example, delegation languages allow graph
  657. inheritance stuctures).  Some don't like the coupling of classes (as in Jade),
  658. but in the author's opinion many of their complaints are easily answered.  In
  659. systems that provide inheritance, inheritance provides a simple and elegant way
  660. to reuse code and to model the real world in a meaningful way.
  661.  
  662. Others complain multiple inheritance is too complicated because it brings up
  663. the issues of shared bases and member conflict resolution.  But most modern
  664. systems support Multiple Inheritance by employing semantic resolution
  665. strategies or renaming, and most consider MI to be highly desirable.  See the
  666. latter part of section 1.9 for an example of why MI is important.
  667.  
  668. Some prefer association to MI, claiming "roles" (as defined in [Rumbaugh 91])
  669. should be associations and inheritance should be reserved for a single
  670. hierarchy "creation" mechanism, however this loses polymorphism and loses the
  671. use of inheritance for typical classification.  Representation "roles" can be
  672. supported by dynamic multiple inheritance (DMI) in many situations.
  673.  
  674.  
  675. 1.14)  What Is Specialization/Generalization/Overriding?
  676. --------------------------------------------------------
  677.  
  678. To create a subclass is specialization, to factor out common parts of
  679. derived classes into a common base (or parent) is generalization [Booch 91,
  680. p56].  Overriding is the term used in Smalltalk and C++ for redefining a
  681. (virtual in Simula and C++) method in a derived class, thus providing
  682. specialized behavior.  All routines in Smalltalk are overridable and non-
  683. "frozen" features in Eiffel can be "redefined" in a derived class.  Whenever
  684. a method is invoked on an object of the base class, the derived class method
  685. is executed overriding the base class method, if any.  Overriding in Simula
  686. is a combination of overloading and multiple-polymorphism because parameters do
  687. not have to be declared.  Eiffel and BETA are examples of languages allowing
  688. any member to be redefined and not just methods, as is typical.
  689.  
  690.  
  691. 1.15)  What Is The Difference Between Object-Based And Object-Oriented?
  692. -----------------------------------------------------------------------
  693.  
  694. Object-Based Programming usually refers to objects without inheritance
  695. [Cardelli 85] and hence without polymorphism, as in '83 Ada and Modula-2.
  696. These languages support abstract data types (Adts) and not classes, which
  697. provide inheritance and polymorphism.  Ada-9x and Modula-3; however, support
  698. both inheritance and polymorphism and are object-oriented.  [Cardelli 85, p481]
  699. state "that a language is object-oriented if and only if it satisfies the
  700. following requirements:
  701.  
  702.   - It supports objects that are data abstractions with an interface of named
  703.     operations and a hidden local state.
  704.   - Objects have an associated type.
  705.   - Types may inherit attributes from supertypes.
  706.  
  707.   object-oriented = data abstractions + object types + type inheritance
  708.  
  709. These definitions are also found in [Booch 91, Ch2 and Wegner 87].
  710.  
  711. [Coad 91] provides another model:
  712.  
  713.   Object-Oriented = Classes and Objects 
  714.                     + Inheritance 
  715.                     + Communication with messages
  716.  
  717. Stroustrup's first edition of [Stroustrup 91, '86 p. 37] defines object based
  718. as: "... storing type identification in each object, brings us to a style of
  719. programming often referred to as "object based"", which is quite different
  720. from C+W's.
  721.  
  722. A more modern definition of "object-oriented" includes single-hierarchy
  723. languages and perhaps object id's for unique objects.  Object id's support the
  724. modern notion of relocatable, persistent and distributed objects that can
  725. even migrate across machines.  Distributed Smalltalk's proxy objects [Kim 89,
  726. ch 19 and Yaoqing 93] provide another example of a distributable and migratable
  727. object facility.  Separate type system support is another extension.
  728.  
  729. [Booch 94, 2.2] proposes 7 "Elements of the Object Model"; 4 major and 3 minor:
  730.   Major:
  731.     Abstraction
  732.     Encapsulation
  733.     Modularity
  734.     Hierarchy  (Inheritance)
  735.   Minor:
  736.     Typing
  737.     Concurrency
  738.     Persistence
  739.  
  740.  
  741. 1.16)  Is A Class An Object?
  742. ----------------------------
  743.  
  744. In C++ no, because C++ classes are not instances of an accessible class (a
  745. Meta-Class) and because C++ classes are not accessible to programs.  Classes
  746. are objects in 3 Level Systems and above because classes are instances of
  747. meta-classes.  But classes play a dual role, because objects can only be
  748. declared to be instances of a class (and class objects instances of a
  749. meta-class).  In 1 Level (single-hierarchy) systems, all classes are objects.
  750.  
  751.  
  752. 1.17)  Is An Object A Class?
  753. ----------------------------
  754.  
  755. In a Level 3 System and above yes, but only instances of a Meta-Class are
  756. Classes.  Instances of a Class (ordinary objects) are not classes (excluding
  757. hybrid systems).  However, all objects may be classes in single hierarchy
  758. systems, since any object may act as a class (provide object instantiation or
  759. act as a shared parent).
  760.  
  761.  
  762. 1.18)  What Is A Method? (And Receiver And Message)
  763. ---------------------------------------------------
  764.  
  765. A method implements behavior, which is defined by [Booch 91, p80]:
  766.  
  767.   Behavior is how an object acts and reacts, in terms of its state changes
  768.   and message passing.
  769.  
  770. A method is a function or procedure which is defined in a class and typically
  771. can access the internal state of an object of that class to perform some
  772. operation.  It can be thought of as a procedure with the first parameter as
  773. the object to work on.  This object is called the receiver, which is the object
  774. the method operates on.  An exception exists with C++'s static member functions
  775. which do not have a receiver, or "this" pointer.  The following are some common
  776. notations for invoking a method, and this invocation can be called a message
  777. (or message passing, see below):
  778.  
  779.   receiver.message_name(a1, a2, a3)   
  780.   receiver message_name: a1 parm1: a2 parm3: a3
  781.  
  782. Selector would be another good choice for message_name in the above examples,
  783. although keywords (or formal parameter names, like named parameters) are
  784. considered part of the selector in Smalltalk (and hence Objective-C).
  785.  
  786. If done statically, this can be referred to as invocation, and message passing
  787. if done dynamically (true dynamic binding).  Statically typed dynamic binding
  788. (e.g. C++ and Eiffel) is really in between (checked function pointers).
  789.  
  790. See also section 1.19 below for a discussion on the functional (prefix) verses
  791. message based (receiver based) notation.
  792.  
  793.  
  794. 1.19)  What Are Multi-Methods And Multiple-Polymorphism?
  795. --------------------------------------------------------
  796.  
  797. Multi-methods involve two primary concepts, multiple-polymorphism and lack of
  798. encapsulation.  These issues are orthogonal.  Multiple-polymorphism implies
  799. more than one parameter can be used in the selection of a method.  Lack of
  800. encapsulation implies all arguments can be accessed by a multi-method (although
  801. packages can be used to restrict access, as in CLOS).  Multi-methods can also
  802. imply a functional prefix notation, although the CLOS designers (who coined the
  803. term "multi-method") consider the functional and receiver based forms
  804. (messages) equivalent.  Functional syntax was chosen "in order to minimize the
  805. number of new mechanisms added to COMMON LISP" [Kim ch 4, p70 (D. Moon)].
  806. [Chambers 93] discusses multi-methods in his new OO language, Cecil.
  807.  
  808. Multiple-polymorphism allows specialized functions or methods to be defined to
  809. handle various cases:
  810.  
  811.   +(int, int)
  812.   +(int, float)
  813.   +(int, complex)
  814.   +(int, real)
  815.   +(float, complex)
  816.   +(float, real)
  817.   +(float, float)
  818.  
  819. The above functions are specialized to each of the cases required allowing
  820. single, highly cohesive and loosely coupled functions to be defined.  This is
  821. also the true essence of object-oriented polymorphism, which allows objects to
  822. define methods for each specific case desired.  In addition to better coupling
  823. and cohesion, multiple-polymorphism reduces program complexity by avoiding
  824. coding logic (switch statements) and because small methods further reduce
  825. complexity, as code complexity doesn't grow linearly with lines of code per
  826. method, but perhaps exponentially.  This should be distinguished from double
  827. dispatch, a fancy name for single dispatch after a call, which only provides
  828. switching on a single argument per call (but for 2 levels), consistently
  829. ignoring the inherent type of parameters in messaging.  Double dispatch is
  830. used in languages with static typing for simplicity and efficiency
  831. considerations.
  832.  
  833. If all of the above types are Numbers, code can be written without concern for
  834. the actual classes of objects present:
  835.  
  836.   fn(one, two: Number): Number
  837.     return one + two;
  838.  
  839. The addition expression above will invoke the correct "+" function based on the
  840. inherent (true, actual, or dynamic) types of one and two.  Only the inherent
  841. type of "one" would be used with double dispatch!  In the author's opinion,
  842. this is a serious shortcoming.  Further, double dispatch would only allow
  843. switching to the "fn" function based on the type of "one" also.  This could
  844. lead to the use of switch statements based on type or complex coding in many
  845. real-world programming situations, unnecessarily.  In the author's opinion,
  846. this should only be used as necessary, e.g. if the implementation language
  847. doesn't support multiple-polymorphism and either efficiency considerations
  848. dominate and double dispatch can be suffered, or an embedded dynamic typing
  849. scheme is used.
  850.  
  851. Why do multi-methods allow open access to parameters?  It allows efficient
  852. handling, like C++ friends, usually by allowing representation details of more
  853. than one object to be exposed.  See [Kim ch 4, pp70-71 (D. Moon)] for an
  854. alternative explanation.  While open access can be useful in some cases, it
  855. typically isn't recommended as a general OO practice (see section 1.15, C+W's
  856. requirement 1 for OO languages and Section 1.2 on Encapsulation) and also
  857. violates subtype polymorphism, because only subclass polymorphism is based on
  858. representation and not type.
  859.  
  860. Polymorphic languages can be statically typed to provide strong type checking,
  861. efficiency, and to support a static programming idiom, but require restrictions
  862. in many cases, such as requiring overriding methods to have identical
  863. signatures with the methods they substitute (as in C++) or allowing covariant
  864. parameters but limiting base class usage (as in Eiffel).  If these restrictions
  865. are dropped, multiple-polymorphism results.  Thus a single overridable function
  866. declared in a base class may have several functions overriding it in a derived
  867. class differentiated only by their formal argument types.  This therefore
  868. requires both static and dynamic typing, because no formal argument
  869. differentiation is possible without static types, as in Smalltalk, and no
  870. actual argument differentiation is possible without dynamic types (as in C++
  871. and Eiffel).  See section 2.3 for another example of multiple-polymorphism.
  872.  
  873. There is some concern about the efficiency of run-time method selection as
  874. can occur with multiple-polymorphism (or even dynamic message passing).
  875. However, static analysis optimizations are commonly available in the
  876. literature, potentially providing a single static selection in many cases
  877. [See Agrawal 91, Chambers 92, Mugridge 91, and etc.].
  878.  
  879. But coupling the two cases of selector variables (as found in CLOS,
  880. Objective-C, and etc.) and several possible known selectors together with the
  881. general undecidability of dynamic types at compile-time renders dynamic typing
  882. and run-time selection (or checking) as unavoidable in the general case [a
  883. point often mistaken in comp.object.  E.g. simple statically/strongly typed
  884. multi-methods still require dynamic types!]
  885.  
  886. See [Booch 91], multiple-polymorphism, for a good CLOS example.
  887.  
  888.  
  889. 1.20)  What Is OOP?
  890. -------------------
  891.  
  892. OOP stands for Object-Oriented Programming, the usual programming/hacking and
  893. etc. most programmers think of.  Modern software engineering methodologies;
  894. however, consider OOP as the implementation/evolution of an OOD.
  895.  
  896.  
  897. 1.21)  What Is OOA/OOD (And Where Can I Get What I Need On It)?
  898. ---------------------------------------------------------------
  899.  
  900.   See also section 3.7, the Annotated Bibliography, and APPENDIX D.  The
  901.   classified bibliography in [Booch 94] also contains entries on OOA(B), OOD(F)
  902.   and OOP(G).
  903.  
  904. [Booch 91]
  905.   "In OOA, we seek to model the world by identifying the classes and objects
  906.   that form the vocabulary of the problem domain, and in OOD, we invent the
  907.   abstractions and mechanisms that provide the behavior that this model
  908.   requires."
  909.  
  910. [Coad 91]
  911.   "OOA is the challenge of understanding the problem domain, and then the
  912.   system's responsibilities in that light".
  913.   "To us, analysis is the study of a problem domain, leading to a specification
  914.   of externally observable behavior; a complete, consistent, and feasible
  915.   statement of what is needed; a coverage of both functional and quantified
  916.   operational characteristics (e.g. reliability, availability, performance)".
  917.   "Design.  The practise of taking a specification of externally available
  918.   behavior and adding details needed for actual computer system implementation,
  919.   including human interaction, task management, and data management details."
  920.  
  921. And on Domain Analysis:
  922.  
  923.   "Whereas OOA typically focuses upon one specific problem at a time, domain
  924.    analysis seeks to identify the classes and objects that are common to all
  925.    applications within a given domain, [...]".  - [Booch 91]
  926.  
  927.   [The following quotes on domain analysis are from [Berard 93]]
  928.  
  929.   "An investigation of a specific application area that seeks to identify the
  930.    operations, objects, and structures that commonly occur in software systems
  931.    within this area.  - Dan McNicholl
  932.  
  933.   "Systems analysis states what is done for a specific problem in a domain
  934.    while domain analysis states what can be done in a range of problems in a
  935.    domain.  ...A domain analysis is only useful in many similar systems are to
  936.    be built so that the cost of the domain analysis can be amortized over the
  937.    cost of all the systems.
  938.  
  939.    The key to reusable software is captured in domain analysis in that it
  940.    stresses the reusability of analysis and design, not code. - Jim Neighbors
  941.  
  942.   "The process of identifying, collecting, organizing, and representing the
  943.   relevant information in a domain based on the study of existing systems and
  944.   their development histories, knowledge captured from domain experts,
  945.   underlying theory, and emerging technology within the domain."  - Kang et al.
  946.  
  947.   Object-oriented domain analysis (OODA) seeks to identify reusable items
  948.   localized around objects, e.g., classes, instances, systems of interacting
  949.   objects, and kits [frameworks]. OORA analysts and OOD designers will
  950.   interact on a fairly frequent basis with the domain analysis effort.
  951.  
  952.  
  953. OOA and OOD stand for Object-Oriented Analysis and Object-Oriented Design,
  954. respectively.  OOA strives to understand and model, in terms of object-oriented
  955. concepts (objects and classes), a particular problem within a problem domain
  956. (from its requirements, domain and environment) from a user-oriented or domain
  957. expert's perspective and with an emphasis on modeling the real-world (the
  958. system and its context/(user-)environment).  The product, or resultant model,
  959. of OOA specifies a complete system and a complete set of requirements and
  960. external interface of the system to be built, often obtained from a domain
  961. model (e.g. FUSION), scenarios (Rumbaugh), or use-cases (Jacobson).
  962.  
  963. [Shlaer 88] is often credited as the first book on OOA, although their method
  964. adds OO techniques to the traditional structured analysis principles of Yourdon
  965. and Constantine. Their complete approach ([Shlaer 88, 92]) consists of
  966. information modeling and recursive design, or OOA/RD and represents a recent
  967. addition to the structured analysis family (as does Martin and Odell).
  968. [Yourdon 92] provides a critique, although may only refer to their earlier
  969. work.  Many other methodologies including Rumbaugh's OMT, Martin and Odell's
  970. OOA/D, and many others, also share common ground with SA and other existing
  971. analysis methodologies with such constructs as associations (E-R), functional
  972. models, and even DFD's.  Booch, Jacobson, and Wirfs-Brock are examples of OO
  973. methodologies representing a greater departure from the conventional
  974. "structured" techniques, with greater emphasis on objects.  OOram [Reenskaug
  975. 91] provides support and emphasis on types and roles as guiding principles,
  976. which is quite powerful.  [Booch 94] presents a methodology which is an
  977. evolutionary step beyond the first edition by incorporating a collection of the
  978. best features from several of the major OO methodologies, as does HP's new
  979. FUSION methodology.
  980.  
  981. The usual progression is from OOA to OOD to OOP (implementation) and this
  982. Universal Process Model roughly corresponds to the Waterfall Model [Royce 70].
  983. See [Humphrey 89] and [Yourdon 92] for a few of many discussions on software
  984. life-cycle models and their use.  Humphrey also details Worldy and Atomic
  985. Process Models for finer grained analysis and design in the Defined Process
  986. (see below) and discusses other alternatives to the task oriented models.  He
  987. also provides the following critisisms on the Waterfall Model which had led to
  988. Boehm's seminal work on the Spiral Model:
  989.  
  990.   * It does not adequately address changes
  991.   * It assumes a relatively uniform and orderly sequence of development steps
  992.   * It does not provide for such methods as rapid prototyping or advanced
  993.     languages
  994.  
  995. Modern OO methodologies directly address these points and emphasize the
  996. incremental, iterative, evolutionary, concurrent and situational nature of
  997. software development.  [Boehm 86] presents a seminal spiral life-cycle model
  998. with a risk-driven incremental prototyping approach.  [Booch 91, 6.1]
  999. proposes a "round-trip gestalt" design with analyze-design iterations and
  1000. an overall system perspective and [Berard 93] proposes an (incremental)
  1001. "parallel-recursive design" with analyze-design-implement-test iterations.
  1002. [Coad 91b] presents the following development cycle breakdown:
  1003.  
  1004.   Waterfall-
  1005.     Analysis
  1006.     Design
  1007.     Programming
  1008.  
  1009.   Spiral-
  1010.     Analysis, prototyping, risk management
  1011.     Design, prototyping, risk management
  1012.     Programming, prototyping, risk management
  1013.     [Boehm, 1988]  
  1014.  
  1015.   Incremental-
  1016.     A little analysis
  1017.     A little design
  1018.     A little programming
  1019.     Repeat
  1020.     [Gilb, 1988]
  1021.  
  1022. [Author's note: The spiral model is often incremental and may waterfall if
  1023.  called for.]
  1024.  
  1025. Since classes and objects are used in all phases of the OO software life-cycle,
  1026. the process is often referred to as seamless, meaning there is no conceptual
  1027. gap between the phases as is often the case in other software development
  1028. methodologies, such as the analysis (DFD's) to design (structure charts) to
  1029. programming gaps found in traditional structured analysis and design.
  1030. Seamlessness together with naturalness is a big advantage for consistency.
  1031.  
  1032. A problem domain has many realizations, or differing OOAs.  An OOA has many
  1033. realizations, or differing OODs, but a similar notation is often used for
  1034. the two.  An OOD also has many realizations, or differing OOPs, but allows a
  1035. selection from among various languages for implementation (choosing the best
  1036. language to implement the design).  But some, such as Bjarne Stroustrup, don't
  1037. like OOA and OOD getting too far from OOP (implementation independent), for
  1038. fear that great discrepancies could occur between OOD and OOP by losing sight
  1039. of the implementation language, which in some cases is predetermined.  See also
  1040. [Stroustrup 91].
  1041.  
  1042. From a greater perspective, the SEI has developed the Capability Maturity Model
  1043. (CMM), a process-based TQM model for assessing the level of an organization's
  1044. software development and which is often required of government contractors
  1045. in the US [Humphrey 89].  The CMM also serves as a 5 level improvement process
  1046. by specifying steps for organizations to progress to the next level, ultimately
  1047. leading to statistical (process) control and sustained improvement.  Watts S.
  1048. Humphrey is now working on the Personal Software Process (PSP), a scaled down
  1049. version of the CMM for individuals to use (references are forthcoming).  Next
  1050. should follow a team-based software process (TSP?).  Other CMM's in the works
  1051. at the SEI include a personnel management CMM (PM-CMM).
  1052.  
  1053.  Level 1: Initial:    Every project is handled differently; ad hoc and chaotic.
  1054.  Level 2: Repeatable: Every project is handled similarly.
  1055.  Level 3: Defined:    Standard processes are defined and used for all projects.
  1056.  Level 4: Managed:    A measurable basis for all improvements to the process.
  1057.  Level 5: Optimizing: Emphasis on defect prevention and optimizing/continually
  1058.                       improving the process.
  1059.  
  1060. See also:
  1061. Kitson, D.H. and Masters, S. "An Analysis of SEI Software Process Assessment
  1062. Results 1987-1991", CMU/SEI-92-TR-24
  1063.  
  1064. Humphrey, W., Snyder, T. and Willis, R. "Software Process Improvement at
  1065. Hughes Aircraft", IEEE Software, July 1991
  1066.  
  1067. Dion, R., "Elements of a Process Improvement Program," IEEE Software, July
  1068. 1992.
  1069.  
  1070. "Concepts on Measuring the Benefits of Software Process Improvement,"
  1071. CMU/SEI-93-TR-9.
  1072.  
  1073. See also [Yourdon 92], [Wilkie 93], and [Booch 94] for discussions on this
  1074. often cited model.  There is also an ISO 9000 (9001,9003) standard on software
  1075. quality and ami working group in Europe creating the SPICE standard (among
  1076. other work), which is similar in scope to the CMM.  To join the ami mailing
  1077. list email to:
  1078.   ami-request@aut.alcatel.at 
  1079. with the following message: 
  1080.   subscribe firstname, lastname, e-mail address.
  1081.  
  1082. Object-oriented analysis now includes "Enterprise Modeling" [Martin 92], also
  1083. found in [Jacobson 92], and along with recent business "reengineering" efforts
  1084. places information systems within an organizational perspective by modeling
  1085. entire organizations or a large part of them, with the information processing
  1086. system and software products development as integrated components.  [Yourdon
  1087. 92] even calls for "global modeling"!
  1088.  
  1089.  
  1090. 1.22)  Where Did Object-Orientation Come From?
  1091. ----------------------------------------------
  1092.  
  1093. Simula was the first object-oriented language providing objects, classes,
  1094. inheritance, and dynamic typing in 1967 (in addition to its Algol-60 subset).
  1095. It was intended as a conveyance of object-oriented design.  Simula 1 was a
  1096. simulation language, and the later general-purpose language Simula 67 is now
  1097. referred to as simply Simula.  Smalltalk was the next major contributor
  1098. including classes, inheritance, a high-powered graphical environment and a
  1099. powerful dynamic typing mechanism (although these existed to some extent in
  1100. Simula).  Self is somewhat of a Smalltalk-based next generation language, as is
  1101. BETA a followup to Simula (by its original designers).
  1102.  
  1103. [Meyer 88] contains a brief summary and history of Simula and Smalltalk, among
  1104. other OO languages.
  1105.  
  1106.  
  1107. 1.23)  What Are The Benefits Of Object-Orientation?
  1108. ---------------------------------------------------
  1109.  
  1110. Reuse, quality, an emphasis on modeling the real world (or a "stronger
  1111. equivalence" with the RW than other methodologies), a consistent and seamless
  1112. OOA/OOD/OOP package, naturalness (our "object concept"), resistance to change,
  1113. encapsulation and abstraction (higher cohesion/lower coupling), and etc.
  1114.  
  1115. On resistance to change, system objects change infrequently while processes
  1116. and procedures (top-down) are fequently changed, providing object-oriented
  1117. systems with more resilient system organization.
  1118.  
  1119. [Harmon 93]:
  1120.   Faster development
  1121.   Increased Quality
  1122.   Easier maintenance
  1123.   Enhanced modifiability
  1124.  
  1125. [Booch 94]:
  1126.   Exploit power of OOPs
  1127.   Reuse of software and designs, frameworks
  1128.   Systems more change resilient, evolvable
  1129.   Reduced development risks for complex systems, integration spread out
  1130.   Appeals to human cognition, naturalness
  1131.  
  1132.  
  1133. 1.24)  What Other FAQs Are Available?
  1134. -------------------------------------
  1135.  
  1136. FAQ's are cross-posted to news.answers and are archived on anonymous ftp from:
  1137.  
  1138.   rtfm.mit.edu:/pub/usenet        (also usenet-by-hierarchy, etc.)
  1139.  
  1140. rtfm archives several FAQs pertinent to OO (alternative/original sites are listed).
  1141.  
  1142.   comp.lang.ada         ajpo.sei.cmu.edu:public/comp-lang-ada/cla-faq[12]
  1143.   comp.lang.beta        daimi.aau.dk:pub/beta/beta-language-faq.txt
  1144.   comp.lang.c++         sun.soe.clarkson.edu:pub/C++/FAQ [128.153.12.3]
  1145.   comp.lang.clos
  1146.   comp.lang.eiffel      ftp.cm.cf.ac.uk:/pub/eiffel/eiffel-faq
  1147.   comp.lang.modula3
  1148.   comp.lang.oberon
  1149.   comp.lang.objective-c
  1150.   comp.lang.sather      ftp.ICSI.Berkeley.EDU:pub/sather [not on rtfm]
  1151.   comp.lang.scheme      ftp.think.com:/public/think/lisp/scheme-faq.text
  1152.   comp.lang.smalltalk   xcf.Berkeley.EDU:misc/smalltalk/FAQ/SmalltalkFAQ.entire
  1153.   comp.object           zaphod.uchicago.edu:/pub/CompObj6.faq(.Z)
  1154.   comp.object.logic     ftp.cs.cmu.edu:(2)prg_1.faq,prg_2.faq  [128.2.206.173]
  1155.   comp.software-eng
  1156.  
  1157. Notes:
  1158.   1) xcf.Berkeley.EDU is 128.32.138.1
  1159.   2) /afs/cs.cmu.edu/project/ai-repository/ai/pubs/faqs/prolog/
  1160.   3) Beta FAQ www: http://www.daimi.aau.dk/~beta/beta-language-faq.html
  1161.      most current.  Email: info@mjolner.dk with body: send BETA beta-faq
  1162.   4) Modula-3: ftp.vlsi.polymtl.ca:pub/m3/m3-faq.ps.
  1163.                http://froh.vlsi.polymtl.ca/m3/m3-faq.html.
  1164.      Archives: gatekeeper.dec.com:pub/DEC/Modula-3/comp.lang.modula3
  1165.      Newsgroup relay mailing list; message to m3-request@src.dec.com
  1166.  
  1167.