The first lecture on Wednesday
evening left me confused about the meaning of OOP. I also wondered why the focus
of programming had shifted from “another programmer who might read our code”
directed conversations to “client” directed conversations. As I slowly digested
all the details, I realized that this is in fact “Introduction to Computer
Science”, not “Introduction to Computer Programming”. Only then OOP and client
directed conversations started making sense. The meaning of Object Oriented
Programming (OOP) is indicated by its name, that is programming oriented
towards the object as identified by the client.
In CSC108, we learned about “class”,
an entity used to specify a set of functions for a particular purpose, which is
now known as “object”. The use of “object” is significant for developing
software. Classifying an “object” depends on us, the programmers, and this is
where clients come into the picture. For example, a client, who owns a coffee
shop, might want us to develop a program for determining the amount of coffee
beans he or she should order based on the previous month’s sales or simply to
store the nutrition facts of each latte.
These kinds of tasks are specific to the client’s demand, leading us to
classify an “object”, perhaps called “CoffeeShop”. The actual task of determining
the amount of coffee beans required would be done by defining a “method” under “CoffeeShop”,
which if invoked with an instance of that class would produce the required
results. This method might take the number of sales, which would be an “attribute”
of the method. As evident, such a program, would only benefit the client in
that particular scenario, the owner of the coffee shop. Thus, OOP allows us to
use “object” in order to provide functionality through a program for a specific
set of data.
No comments:
Post a Comment