liveBook · Manning

Object family

As explained in Object-Oriented Software Design in C++

An object family is a set of related objects whose implementations are intended to be created together as a compatible product group.

An object family is a set of related objects designed to be created together as a compatible product group. Keeping family members together prevents incompatible combinations. section 9.2 section 9.2.1

A family-based design makes compatibility explicit:

  • VarsityFactory creates varsity players and venues. section 9.2.2
  • IntramuralFactory creates intramural players and venues. section 9.2.2
  • Departments select the appropriate factory instead of constructing family members themselves. section 9.2.2

Sports provisions

A varsity baseball sport receives varsity baseball players and a sports stadium; an intramural baseball sport receives intramural players and an open field. The factory prevents those families from being mixed. section 9.2.1

How Object-Oriented Software Design in C++ covers it

How deep it goes
Explains family selection through abstract and concrete factories, product constructors, and delegated creation.
Examples
Uses engine parts, varsity and intramural sports, players, venues, factories, and Sport constructors.
What it assumes
Assumes basic object-oriented factories and subclasses while teaching how to prevent cross-family construction errors.
What you can do after
Apply it via the Abstract Factory Design Pattern to create compatible groups without exposing concrete classes.
How it connects
Connects object families with the Abstract Factory Design Pattern, Factory Method Design Pattern, and Strategy Design Pattern.

Also explained in

Compare how 2 books explain object family →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Object-Oriented Software Design in C++. The section links point to the parts of the book it draws on.