Wednesday, 22 January 2014

Object Oriented Programming

We have been studying Object Oriented Programming and have found it interesting to say the least.   As the structure and presentation of the course material has been much different than taking CSC108, it has taken some time to adjust to a different way of learning.    The readings that have been posted have been lengthy but informative.  I did not fully grasp the concept of Object Oriented Programming (OOP) from CSC108, but found the reading posted about OOP from week1 readings most useful.    There was one analogy that has really stuck with me from this reading.

It may be helpful to think of a class as a factory for making objects. The class itself isn’t an instance of a point, but it contains the machinery to make point instances. Every time we call the constructor, we’re asking the factory to make us a new object. As the object comes off the production line, its initialization method is executed to get the object properly set up with its factory default settings.”


This gave me a good understanding of what making a Class is all about and strangely enough why we would want/need to make a new Class.    Being able to define your own classes allows you to build your own uniqueness to programs.   Being able to change an equality method to make it unique to the class or changing any other built-in method to make it perform how the designer of the class wants it to is quite interesting.