Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Swift iOS Programming for Kids

You're reading from   Swift iOS Programming for Kids Help your kids build simple and engaging applications with Swift 3.0

Arrow left icon
Product type Paperback
Published in Mar 2017
Publisher Packt
ISBN-13 9781787120747
Length 260 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Steffen D. Sommer Steffen D. Sommer
Author Profile Icon Steffen D. Sommer
Steffen D. Sommer
Jim Campagno Jim Campagno
Author Profile Icon Jim Campagno
Jim Campagno
Arrow right icon
View More author details
Toc

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 this mug has. We could say that the mug has a color which is the color of the ceramic, which in this case is white. We could also say something about the print on the mug. Perhaps we could generalize this into being an image or print that a mug can have. Maybe we could also model the material of the mug, which...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image