Exercise 43. Basic Object-Oriented Analysis and Design

I’m going to describe a process to use when you want to build something using Python, specifically with object-oriented programming (OOP). What I mean by a “process” is that I’ll give you a set of steps that you do in order but that you aren’t meant to be a slave to and that might not always work for every problem. They are just a good starting point for many programming problems and shouldn’t be considered the only way to solve these types of problems. This process is just one way to do it that you can follow.

The process is as follows:

1. Write or draw about the problem.

2. Extract key concepts from 1 and research them.

3. Create a class hierarchy and object map for the concepts.

4. Code ...

Get Learn Python 3 the Hard Way: A Very Simple Introduction to the Terrifyingly Beautiful World of Computers and Code, First Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.