Activity 01
Pair Programming: Vehicle Design Challenge
Pairs sketch 'is-a' and 'has-a' relationships for vehicles, engines, and wheels. They code both inheritance and composition versions, then run tests to swap engine types. Discuss which approach allows easier changes.
Differentiate between 'is-a' and 'has-a' relationships in object-oriented design.
Facilitation TipDuring the Pair Programming: Vehicle Design Challenge, ask pairs to swap partners after the first 20 minutes to expose them to different design approaches.
What to look forPresent students with two class diagrams: one using inheritance (e.g., 'Dog' inherits from 'Animal') and another using composition (e.g., 'Car' has an 'Engine'). Ask students to write one sentence for each diagram explaining the relationship modeled and identify which uses 'is-a' and which uses 'has-a'.