chapter9 (abstract pattern)