Skip to Content
Object Design Style Guide
book

Object Design Style Guide

by Matthias Noback
January 2020
Intermediate to advanced
288 pages
6h 45m
English
Manning Publications
Content preview from Object Design Style Guide

Chapter 7. Performing tasks

This chapter covers

  • Using command methods to perform tasks
  • Using events and event listeners to split up larger tasks
  • Dealing with failure in command methods
  • Introducing abstractions for commands
  • Creating test doubles for command calls

Besides retrieving information from objects, you can use objects to perform a variety of tasks for you:

  • Send a reminder email
  • Save a record in the database
  • Change the password of a user
  • Store something on disk
  • And so on . . .

The following sections provide rules for methods that perform tasks like these.

7.1. Use command methods with a name in the imperative form

We already discussed query methods and how you should use them to retrieve information. Query methods have a specific ...

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.
Start your free trial

You might also like

Object Design Style Guide

Object Design Style Guide

Matthias Noback
Design It!

Design It!

Michael Keeling
The Art of Clean Code

The Art of Clean Code

Christian Mayer

Publisher Resources

ISBN: 9781617296857Publisher SupportOtherPublisher WebsiteErrata PagePurchase Link