liveBook · Manning

Extensibility

As explained in Functional Design and Architecture: Examples in Haskell

Extensibility is the ease with which a software system can accommodate new capabilities, types, or variations.

Extensibility is a software quality: the system should accommodate new capabilities, types, or variations without requiring a rewrite. It must be balanced with simplicity and maintainability. section 1.2.1

The expression problem exposes two dimensions of extension: adding new data types and adding new behavior. Supporting both simultaneously is difficult in many statically typed designs. section 11.2.2

Design choices shift the difficulty between approaches:

  • Object-oriented designs commonly add types through inheritance or duck typing, allowing existing logic to work with new implementations. section 11.2.2
  • Strongly typed functional designs without subtype polymorphism require type classes and additional type-level mechanisms to express future admissible inputs. section 11.2.2
  • A typed persistence interface can make key–value data available to business logic without unsafe string handling, unnecessary wrappers, or ceremony. section 11.2.2 section 11.0

Typed persistence with extensible records

A key–value database can expose typed operations such as loading Meteor and Comet records, then convert persistence representations into domain values. The interface extends the database model while keeping business code typed. section 11.2.2

loadMeteor :: DBHandle AstroDB -> MeteorID -> LangL KVDBMeteor
loadComet  :: DBHandle AstroDB -> CometID  -> LangL KVDBComet
 
fromKVDBMeteor :: KVDBMeteor -> Meteor
fromKVDBComet  :: KVDBComet  -> Comet

Inspect the paired loading and conversion signatures for Meteor and Comet values. section 11.2.2

How Functional Design and Architecture: Examples in Haskell covers it

How deep it goes
Defines data and behavior extensibility, contrasts object-oriented and functional approaches, and names type-level mechanisms without developing their internals.
Examples
Uses typed key–value persistence for Meteor and Comet records, with raw storage representations converted into domain values.
What it assumes
Assumes software-design familiarity and introduces the contrast between object-oriented and strongly typed functional techniques.
What you can do after
Evaluate how typed designs accommodate new data types and methods while preserving business-logic safety.
How it connects
Connects extensibility with the expression problem, subtype polymorphism, inheritance, duck typing, type classes, and type-level design.

Also explained in

Compare how 7 books explain extensibility →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Functional Design and Architecture: Examples in Haskell. The section links point to the parts of the book it draws on.