Skip to Main Content
Simple Object-Oriented Design
book

Simple Object-Oriented Design

by Mauricio Aniche
May 2024
Intermediate to advanced content levelIntermediate to advanced
192 pages
4h 26m
English
Manning Publications
Content preview from Simple Object-Oriented Design

4 Managing dependencies

This chapter covers

  • Reducing the effect of coupling in the class design
  • Depending on high-level, more stable code
  • Avoiding tightly coupled classes
  • Increasing flexibility and testability with dependency injection

In any software system, classes get together to deliver more extensive behavior. For example, a service class may depend on several repositories and entities to do its job. This means the service is coupled to these other classes.

We’ve discussed the problems of large classes and the advantages of smaller classes. On the one hand, having a class depend on other classes instead of doing everything alone is good. On the other hand, once a class delegates part of its task to another class, it has to “trust” the ...

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

Publisher Resources

ISBN: 9781633437999Publisher SupportOtherPublisher WebsitePurchase Link