Chapter 5: Trade-offs and adoption of immutable design

In this chapter

  • 5.1 Start where changes are small and benefits are large
    • The proper scope of traceability
    • Safer concurrent reads do not eliminate concurrency control
  • 5.2 The main costs
    • Enforcing business rules requires controlled updates
    • Organization affects discoverability
    • Allocation and deeply nested updates
  • 5.3 You do not need one model for every layer
    • ORM-tracked objects can remain mutable
    • Two-way editing UIs usually need mutable ViewModels
    • Test serialization contracts
    • Objects that enforce business rules need not become records
  • 5.4 Adopt gradually to control complexity
    • Common overuse
    • Decision table
  • 5.5 Reviewing AI-proposed immutable refactorings
  • 5.6 Chapter review

This chapter is not available in the free preview. Purchase the book to read the complete edition now.

Buy this book