Object oriented switch