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 5. Using objects

This chapter covers

  • Using a template to write methods
  • Validating method arguments and return values
  • Dealing with failure inside a method

Having instantiated an object, you’re ready to use it. Objects can offer useful behaviors: they can give you information and they can perform tasks for you. Either way, these behaviors will be implemented as object methods.

Before we discuss the design rules that are specific for either retrieving information or performing tasks, we’ll first discuss something these methods should have in common: a template for their implementation.

5.1. A template for implementing methods

Whenever you design a method, you should remember the following template.

Listing 5.1. A template for methods ...
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