You should read up on Object oriented programming (OOP). There are many books and papers on the topic.
Start with Wikipedia and Google for an unending list of sites to read.