Summary

Completed

In this module, you started by learning what object-oriented programming (OOP) is and how you can use it to model a problem domain. You were given a problem domain, and you explored an approach to find its main constructs, objects, data, and behavior.

You were then introduced to classes and how they differed from objects. Additionally, you learned how to organize your data around objects and add that data to the appropriate class definitions.

After that, you went through an exercise where you started working on a project to implement the game rock, paper, scissors. You started with a modeling exercise. You also scaffolded some starter code based on the objects and data identified when you were modeling.

You then looked at how you can add behavior to objects to operate on an object's data. Additionally, you learned about an important principle called encapsulation. Encapsulation is about hiding your data from other objects and instead communicating via methods. Python encapsulates the object's data by using prefixes on the variable naming.

Finally, you learned to add behavior to your rock, paper, scissors game and got a working piece of software. As an added bonus, you also learned how you could extend your game with the choices lizard and Spock. In that way, you were shown how little you needed to modify.

You should now have a good understanding of how to model your problems by using OOP methodology and how to implement code, to support your model, by using OOP constructs.