object oriented technique sample code