Software Design Principles and Patterns
Classified in Computers
Written at on English with a size of 4.98 MB.
Lecture 2: Dynamic Dispatch and Interfaces
- Dynamic Dispatch: The process of selecting which implementation of a polymorphic operation to call at runtime.
- Interface: Calling a method that is not in the interface will cause a compilation error.
Lecture 3: N/A
Lecture 4: Method Contracts, Exceptions, and Unit Testing
- Method Contract: Should define pre/post conditions and exceptional behavior. The client is to blame if the precondition is not met, and the service is to blame if the postcondition is not met. Exceptional behavior specifies what the code will do if a precondition is violated.
- Exception: Runtime exception (unchecked) and IO exception (checked). The IO exception must be caught; otherwise, the code won't compile.
- Unit Test: Test boundary