SENG 365 — Software Engineering
2026-07-24
Reading: Robillard, 3rd ed. — Ch. 3, Types and Interfaces (pp. 43–66).
Design for other classes to use (clients) vs. internal implementation.
Deck offer? A Card? A Game?Interface decouples definitions from implementation.inspect is frowned upon in Java (but possible via reflection); more central in dynamically typed languages.Explain polymorphism to your neighbour. Create one concrete example, and list an advantage.
Different ways to compare things. Comparable says a type can be compared; Comparator says how.
CardWrite the car comparators. Add a byBrakingDistance comparator as a lambda.
An interface expecting hasNext() and next().
Iterable indicates a set of things can be iterated over.“Define a family of algorithms, encapsulate each one, and make them interchangeable.”

Neil Ernst ©️