Page 32 : 41
Object-oriented Programming in C#
Abstract classes, Interfaces, and Patterns
* Method Combination
Method Combination
Parameter Variance
Covariance and Contravariance
* Abstract Classes - Sealed Classes
Abstract Classes
Abstract classes and abstract methods in C#
Abstract Properties
Sealed Classes and Sealed Methods
* Interfaces
Interfaces
Interfaces in C#
Examples of Interfaces
Interfaces from the C# Libraries
Sample use of IComparable
Sample use of IEnumerator and IEnumerable
Sample use of IFormattable
Explicit Interface Member Implementations
* Patterns and Techniques
The Composite design pattern
A Composite Example: Music Elements
An application of Music Elements
Implementation of MusicElement classes
A Composite example: IntSequence
A Composite example: IntSequence application
Implementation of the IntSequence classes
A Composite Example: A GUI
A Composite Example: A GUI
A Composite Example: A GUI
Cloning
Cloning in C#
Cloning versus use of copy constructors
The fragile base class problem
Factory design patterns
The design pattern Factory Method
The design pattern Abstract Factory
The Visitor design pattern
Natural object-oriented IntSequence traversals
Towards a Visitor solution
A Visitor example: IntSequence
Visitors - Pros and Cons
Cloning versus use of copy constructors
Cloning with
obj.Clone()
is more powerful than use of copy constructors, because
obj.Clone()
may exploit polymorphism and dynamic binding
A cloneable class Point.
A cloneable class ColorPoint.
Polymorphic Cloning of Points.
Non-polymorphic Cloning of Points - with use of copy constructors.
Output of both polymorphic and non-polymorphic cloning.