From the course: Programming Foundations: Object-Oriented Design

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Identifying class responsibilities

Identifying class responsibilities - Python Tutorial

From the course: Programming Foundations: Object-Oriented Design

Start my 1-month free trial

Identifying class responsibilities

- We need to figure out the responsibilities for our conceptual objects to really identify what are, and what are not classes that we'll need to create, and just as we started by picking out nouns in our written description to create a list of potential objects we can go back to the use cases and user stories to look for verbs, and verb phrases to identify responsibilities. - Looking at our use case for dodging a missile, we have phrases related to the space ship like spawns enemy spaceship, flies towards player, and fires missile, the player steers asteroid to avoid missile, and the missile flies past player and disappears offscreen. Now not all of these will necessarily become behaviors, some might need to be combined, some might need to be split apart, and some may not be needed at all or will be replaced by something else. But they're a good starting point and will often prompt other discussions. - Something that isn't always obvious, is where these responsibilities belong…

Contents