Chapter 5. When to Use Object-oriented Programming
In the previous chapters, we've covered many of the defining features of Object-oriented Programming. We now know the principles and paradigms of Object-oriented Design, and we've covered the syntax of Object-oriented Programming in Python.
Yet, things are still hazy when it comes to knowing how and when to apply these principles and syntax. Here, we'll discuss some of the more useful applications of the knowledge we've gained, while in Chapter 7, we'll cover something just as important: when not to use them! In this chapter we'll cover:
How to recognize objects
Data and behaviors, once again
Wrapping data in behavior using properties
Restricting data using behavior
The Don't Repeat Yourself principle
Recognizing code that is the same