inheritance-with object writer