Object-oriented methodology
- Class
- Object
- is an instance of a class
- three properties characterize objects
- identity
- state (members)
- behaviour (methods)
- Inheritance - a.k.a generalization
- Subtyping - adding details to a generic datatype to create a more specific datatype
- Members
- Methods
- Instance Method - is associated with an object
- Class Method - is associated with a class, a.k.a. static method
- Constructor (instantiation)
- Instantiates a Class
- Establishes Class invariant
- Copy Constructor
- Deep/Shallow Copy
- Destructor
- Accessor
- Mutator
- Abstract Method - has no implementation
- Virtual Function - is a function that when overridden by a subclass will be used by the base class
- Polymorphism - ad-hoc (overloading), parametric (templates?)
- polymorphic function - can evaluate to and be applied to values of different types
- polymorphic datatype - contains elements of different datatypes
- UML Diagrams
- Class Diagrams
- Generalization
- Aggregation, Composition
-
- Object Diagrams
- Sequence Diagrams
- Collaboration Diagrams
- StateCharts
- The Liskov Substitution Principle -
Functions that use pointers or references to base classes must be able to
to use objects of derived classes without knowing it
- Implementations
- C++
- Java
- JavaScript
- Python
- Ada
- SmallTalk
- Eiffel
- ...