0. At its most basic level, it means that rather than writing
one long program to deal with a specific problem, you break that problem down into chunks and
write smaller blocks of code (objects) to address each part of the problem. There are many benefits
to OOP, but there are two obvious ones that I??™ll mention here. First of all, although you??™re writing an
application to address a specific problem, because the code objects are separate functional blocks,
you can use them again in other applications. For example, you may create a simple object for a calculator
application that takes a set of values and returns the average. If you were then to create, say,
a graphing application, you could use the same ???Average??? object in your new application without having
to program it again from scratch. Second, it??™s easy to update or modify object-oriented code
because you can make changes to a specific object without affecting the rest of the application. Those
are just two examples, but you get the idea that OOP is a useful approach to follow.
If this definition is not clear now, don??™t worry??”as we continue it will become clearer. Just remember
to come back and read it again if you need to, once you are done reading the rest of the chapter.
There is one other key OOP concept that you should know early on: the difference between classes
and objects. Let??™s take an example of a schematic you??™ve designed to manufacture a toy rubber duck.
The schematic, or blueprint, is the class for the rubber duck.
Pages:
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104