11.5 Design
We begin by creating a basic design for our simulation based on the previous description. The first step is to identify those parts of the problem that correspond to objects. One of the easiest ways to start the process of object identification is to consider the prominent nouns that appear in the description of the problem. In this case, words such as bear, fish, and world seem like good choices. The nouns that we identify now will likely become Python classes when we implement the design.
Next, we need to analyze each noun and come up with a list of things that it should know and a list of actions that it can perform. The list of things that an object should know will become instance variables. The list of things that an object ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access