Group: type inheritance
Topic: abstract functions
Topic: declaration scope
Topic: generic operations and polymorphism
Topic: function signature
Topic: interface type
Topic: object-oriented data types
Topic: object-oriented templates and containers
Topic: parameter passing by message
Topic: procedure valued variables
Topic: remote procedure call
| |
Summary
In Smalltalk, a procedure is a method. Its actions consist of sending messages to objects, assigning values, and returning values. In C++ and other object-oriented extensions to programming languages, a procedure is similar to normal procedures with dynamic or static binding. The procedure is called by passing a message.
Object-oriented procedures are natural polymorphic since the object's class determines the invoked procedure. (cbb 1/90)
Subtopic: methods
Quote: a method is a named piece of code that is part of an object
| Subtopic: dynamic binding independent of representaiton
Quote: dynamically bound messages allow methods to transcend the representation of the objects they manipulate [»ungaD10_1992]
| Quote: a spec-type either branches on the actual mode or its variables carry its procedures [»parnDL3_1976]
| Subtopic: polymorphism
Quote: object-orientation overcomes the complexity of polymorphism in extensible languages [»ingaDH9_1986]
| Subtopic: single dispatching
Quote: most object-oriented systems use single dispatching; i.e., a message is sent to one object; e.g., "5+4" is 5.plus(4) [»taivA9_1996]
| Quote: single dispatching does not match binary operations; e.g., possible code duplication for mixed integer and floating point arithmetic
| Quote: single dispatching encourages the definition of abstract data types; multiple dispatching does not [»taivA9_1996]
| Subtopic: double dispatch
Quote: explicit, multi-method invocation in C++ by double dispatch; choose the most specialized branch; e.g., visitor pattern [»bettL5_2006]
| Quote: static, well-typed, multi-method dispatch; unique return type and most specialized branch; no ambiguity, no message-not-understood [»bettL5_2006]
| Quote: in object-oriented programming, more than one variable may be polymorphic; requires case analysis and poor modularity [»ingaDH9_1986]
| Quote: handle messages that are doubly polymorphic, by sending additional messages to the second argument [»ingaDH9_1986]
| Subtopic: predicate dispatch
Quote: predicate dispatch invokes a method only if a predicate is true; JPred uses decision procedures for dispatch and type checking; based on Cooperating Validity Checker (CVC) [»millT10_2004]
| Subtopic: method invocation
Quote: Smalltalk actions (in a method) consist of sending messages, assigning variables, and returning a value
| Quote: a class method is a system object that only responds to messages for which it is designed [»liebH11_1986]
| Quote: the basic TOPD statement is a procedure call v.p (v1,...,vn); v is both the first argument and indicates the class by its type [»hendP9_1975]
| Quote: ITT 1240 application software consists of finite message machines (messaging) and system support machines (procedure calls) [»bonaR_1981]
| Quote: the name of a CLU operation is always 't$o' where 't' is a type name; avoids overloading and enhances program correctness and readability [»liskB_1996]
| Quote: a query returns information about an object
| Quote: operate on a Mach object by sending a message to a port [»acceM6_1986]
| Quote: when the receiver of a message completes, the caller resumes; the receiver can return a value [»goldA3_1976]
| Subtopic: method dictionary
Quote: Smalltalk-80 assigned a method dictionary to each class-describing object; associates selectors with methods [»krasG8_1981]
| Quote: each Oberon module includes a table of commands giving name and entry address; called by M.P [»wirtN9_1989]
| Quote: an OOPC selector is a string of keywords that describe arguments; like Smalltalk [»coxBJ1_1983]
| Quote: in OOPC a message is an object name, selector, and arguments; implement with a subroutine that locates method in a class [»coxBJ1_1983]
| Quote: to create a Smalltalk method, select a method category and fill in the template in the editing plane [»teslL8_1981]
| Quote: a Smalltalk method describes actions for a selector received by an instance of a class [»xlrg8_1981]
| Quote: a Smalltalk method consists of a message pattern, temporary variables, and a list of expressions [»xlrg8_1981]
| Subtopic: inline methods
Quote: in Smalltalk, high frequency methods implemented as a bytecode instead of dictionary lookup [»krasG8_1981]
| Subtopic: control structures
Quote: in Smalltalk build control structures by block parameters; i.e., executable code [»deutLP8_1981]
| Subtopic: types of inheritance
Quote: use private and protected functions whenever an object does not satisfy the class invariant [»stroB_1991]
| Quote: a virtual CLR method may be final (no derivation), new (parent method accessible), abstract (no implementation); interface methods are virtual [»hamiJ2_2003]
| Subtopic: method modification
Quote: because of Java's late binding it is easy to change methods and private variables; just need to retain old methods or their type signatures [»goslJ6_1997]
| Quote: if functions directly read or write members, they can make a class an implementation instead of an abstraction
| Subtopic: types of methods -- modifiers, predicates, functions
Quote: Ruby uses a ! suffix to indicate methods that modify their object, and ? for predicates [»thomD1_2001]
| Quote: types of operations on a class: foundation operators, selectors, modifiers, conversion operators, iterators [»stroB_1991]
| Quote: categorize methods/functions as command or query; freely use queries while commands hide information [»huntA1_2003]
| Subtopic: class method
Quote: a class method is not a method at all; it is a function, without a receiver [»batesR11_2004]
| Quote: Smalltalk accessed class variables and methods through the instance variable of the class' metaobject [»batesR11_2004]
| Subtopic: 'this' reference
Quote: use 'this' in C++ to refer to the object that invoked a member function; primarily used for pointer manipulation [»stroB_1991]
| Subtopic: problems with methods
Quote: be careful of making members virtual; they cause subtle and complex observable behaviors and subclass interactions [»cwalK_2006]
| Quote: Smalltalk's inheritance mechanism makes it difficult to find which method is executed, especially if the receiver's class is unknown [»nielJ5_1989, OK]
| Quote: most common Smalltalk error is 'message not understood' [»teslL8_1981]
|
Related Topics
Group: type inheritance (13 topics, 394 quotes)
Topic: abstract functions (11 items)
Topic: declaration scope (16 items)
Topic: generic operations and polymorphism (67 items)
Topic: function signature (21 items)
Topic: interface type (50 items)
Topic: object-oriented data types (29 items)
Topic: object-oriented templates and containers (27 items)
Topic: parameter passing by message (31 items)
Topic: procedure valued variables (34 items)
Topic: remote procedure call (44 items)
|