Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

Chapter 3. Adding Objects > Understanding Objects - Pg. 76

76 Introducing Objective-C A new programming paradigm that enabled developers to encapsulate both the data that they wished to operate on and the logic to operate on that data together in one package was needed. The name for this new programming paradigm is object-oriented programming. In the following sections, I introduce you to this technology. Understanding Objects The idea behind object-oriented programming is to allow a programmer to encapsulate the data that you want to operate on with the procedures that you want to use to operate on the data. For example, imagine that you want to encapsulate the behavior of a cat. The first thing that you need to do is capture the attributes of that cat -- its data. Figure 3.1 shows an illustration of this concept. You might want to capture the properties of the color of the cat. In this case, the color of the cat is black. Figure 3.1 Encapsulating the properties of a cat