Free Trial

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


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

12. OOA&D > OOP Principles

OOP Principles

image

Most design, in programming or any other field, doesn’t start with a completely blank whiteboard. Even when presented with an entirely new problem (which is rare), a good designer will apply the principles of the field. You’ll do the same. They’re the most important tools in your toolbox.

We’ve already looked at one of them: the identification of object relationships that helps you decide how you represent them. In this section, we’ll examine the four basic principles of Object-Oriented Programming: inheritance, abstraction, encapsulation, and polymorphism. Let’s start by looking how the boys use these principles when they develop a new recipe:

image

Inheritance

The ability for a type to inherit state and behavior from another type.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


 Â