Modeling real-world objects

To get a better understanding of how we can model objects in OOP, let's try to go through a couple of examples from the real world. As you will see, there are a lot of similarities when we try to model real-world objects and objects in our programs.

Modeling a mug

Using our knowledge about what OOP is, let's look at a more concrete example. Let's take a look at the object in the following photograph:

Modeling a mug

Using our real-world knowledge combined with common sense, what could be some characteristics of this mug? Instead of considering the actual values or the specifics of the mug, let's try to come up with a set of properties ...

Get Swift iOS Programming for Kids now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.