Identify Class Responsibilities in Object-Oriented Design


show more While programming, drafting use cases and user stories can point to class responsibilities. These are the actions that each class will take. For example, a customer might be responsible for paying for items, entering payment information, and providing an address. Identifying class responsibilities allows you to assign functionality based on those responsibilities. Learn how to quickly and easily define responsibilities for classes by watching this online video. show less
please wait ...

Identifying class responsibilities

We're trying to get to the point where we can truly identify what are and what aren't classes that we need to create. And much of this comes from figuring out the responsibilities of our conceptual objects, and this will be the behavior what will become methods in our objects, and here is a great starting point for this. Just as we started off by looking at the nouns in our written description to figure out our potential objects, we can go back to the use case or a user story, and look for verbs and verb phrases to pick responsibilities.

So in this case, we'd have things like customer verifies items, provides payment and address, process sale, validate payment, confirm order, provide order number, check order status, and send order details email. Now, not all of these will become behaviors, some will be combined, some will need to be split apart, and some will just not be needed or be replaced by something else, but they are a good starting point, and they will often prompt others, or p...

Identifying class responsibilities
Video duration: 6m 43s 3h 1m Intermediate

Viewers:

While programming, drafting use cases and user stories can point to class responsibilities. These are the actions that each class will take. For example, a customer might be responsible for paying for items, entering payment information, and providing an address. Identifying class responsibilities allows you to assign functionality based on those responsibilities. Learn how to quickly and easily define responsibilities for classes by watching this online video.

Subject:
Developer
Software:
Java
Author:
please wait ...