Avoiding the dogma - a plea for mutable objects
summary
Argues immutable-by-default is dogma and shows a concrete alternative: wrap backend DTOs in proxy objects that expose getters, override fields for optimistic updates, and call notifyListeners; store proxies in a central repository keyed by ID with a reference count to keep multiple feeds in sync. Uses a command object (flutter commands package) that provides value-listenables for canExecute/isExecuting/errors, prevents double calls, and supports an undo stack for failed API calls. Proven in a real project for two years and demoed with frequent failures where optimistic updates reliably roll back.
AI-written summary · about
chapters (10)
- 0:00Mutable objects plea
- 2:10Dogma of immutable data
- 7:30Functional programming limits
- 8:11Elegance of mutable objects
- 11:50Controlling data access
- 13:17Proxy pattern for data
- 18:29Synchronizing shared objects
- 23:11Commands for state changes
- 29:53Conclusion
- 30:14Q&A
related talks
51mA Clean, Pragmatic Architecture
50mA Guide to Managing External APIs in Enterprise Systems
52mEvolving a Pragmatic, Clean Architecture A Craftsman's Guide
01h 05mNo Touchy! A Case Study of Software Architecture with Immutable Objects
42mGoing Offline first with Flutter
59mDomain-Driven Design - Where Rubber Meets the Road
01h 02mObjects vs Values: Value Oriented Programming in an Object Oriented World
41mFlutter Architecture Components
