Extensibility lets you add new behavior with little or no impact on existing behavior. Ideally, you add code rather than rewrite code that already works. section 7.1
Think of a web browser with a plugin system: ad blockers and note-taking extensions add capabilities the browser was not built to predict. Extensibility makes later needs possible without rebuilding the core. section 7.1
Recognize extensible design by how new features enter the system:
- Add classes, methods, functions, or data that encapsulate the new behavior. section 7.1.1
- Keep concerns separated and components loosely coupled so features remain isolated. section 7.1
- Avoid shotgun surgery: a feature that requires scattered edits and new conditionals is difficult to extend and maintain. section 7.1.1
- Invest in design when software will be reused or updated often; extensive redesign may not justify itself for a rarely used script. section 1.5
Adding a response format
Separate response formatting into functions and select one through a mapping from an Accept header. To support another format, add its formatter and mapping entry instead of changing the main endpoint’s behavior. section 9.2.2
Extending an application
A multitier bookmarking application can add an “Import GitHub stars” feature by placing persistence, business logic, and user-interaction changes in their appropriate areas. Interfaces and the command pattern reduce later extension work. section 7.0 section 11.5.1
Use the figure to compare adding behavior through isolated extension points with changing existing code. section 7.1.1






