Abstract classes, Interfaces, and Patterns
- slide 2 : 37
Method Combination
We sometimes talk about
method combination
when two or more methods of the same name
Op
cooperate in solving a given problem
Programmatic (imperative) control of the combination of
Op
methods
Superclass controlled
: The
Op
method in class A controls the activation of
Op
in class B
Subclass controlled
: The
Op
method in class B controls the activation of
Op
in class A
Imperative method combination
An overall (declarative) pattern controls the mutual cooperation among
Op
methods
A.
Op
does not call B.
Op
- B.
Op
does not call A.
Op
.
A separate abstraction controls how
Op
methods in different classes are combined
Declarative method combination
C# supports subclass controlled, imperative method combination via use of the notation
base.Op(...)